OK
if I understand correctly your problem is converting the double values to pixel coordinates. If that is the case you need to do something like this:
POINT CoordToPixel(Double X, Double Y)
{
double XDistance = LargestXVal - SmallestXVal; double YDistance = LargestYVal - SmallestYVal; double LargestDistance = (XDistance >= YDistance) ? XDistance : YDistance; double Scale =
((DisplayAreaXSize <= DisplayAreaYSize ?
DisplayAreaXSize : DisplayAreaYSize) - BORDER_SIZE * 2) / LargestDistance;
POINT ScreenPosition;
ScreenPosition.x = (X - GetSmallestXVal()) * Scale + BORDER_SIZE + 0.5;
ScreenPosition.y = (Y - GetSmallestYVal()) * Scale + BORDER_SIZE + 0.5;
return ScreenPosition;
}
You will need to figure out how to get the border size, display area's X & Y sizes and the largest and smallest X & Y values but none of those should be too much of a problem.
EDIT: Don't forget to add the border offset to the X and Y coordinates. Also I added
+ 0.5
to X and Y for rounding purposes.