I've been handed a csv file containing a series of coordinates, from which lines should be drawn on top of a bitmap grid; I can get the values out and convert them into ints for the DrawLine function, etc, just fine.

The problem is that these coordinates are basically percentages; x:0.5 and y:0.5 represent dead centre (being 50% of X and 50% of Y) and x:1.0/y:1.0 would be in the top right regardless of the absolute dimensions of what is being plotted on to (in this instance a 1000x1500 bitmap). In addition screen/window coordinates start in the top left which doesn't affect the x-axis but the y-axis needs to be somehow inverted.

So what do I need to do to the coordinates to get them to plot correctly? To be honest I've got the X-axis working fine, it's the Y-axis giving me the problems.

I'm not calculating it at all, it's coming straight out of a file. I use StreamReader to get it out, perform a Regex Replace to get the raw number, then use int.Parse and pass it to the DrawLine function. The problem is, as I stated, that the computer simply doesn't understand that format, windows coordinates start at the top left, not the bottom right, THAT is my problem.
–
user1006221Oct 21 '11 at 21:00

If you can not understand how what I wrote inverts the y value, I'm not sure I can help you.
–
BoltBaitOct 21 '11 at 22:49