You did actually all that is necessary for your own coordinate calculation, assuming you leave the windows viewport in its native (text) mode. The two factors
ScreenXSeconds
and
ScreenYGain
are the factors with which you have to multiply the raw values. The names chosen are not to my liking, but that's another story. For the sake of our discussion, lets call them
scaleX
and
scaleY
. Then you would calculate the screen coordinates for raw point (rx, ry):
double scaleX = rectClient.Width() / 3051.;
double scaleY = rectClient.Height() / 150000.;
...
int x = int (scaleX * rx) + rectClient.left;
int y = int (scaleY * ry) + rectClient.top;
If you want ot have the y-axis grow from bottom to top (as most people do) you need to modify that slightly:
int y = int (scaleY * -ry) + rectClient.bottom;
Instead of switching between integer and double arithmetic back and forth, there is also a pure integer way of doing this:
int x = MulDiv (rx, rectClient.Width(), 3051) + rectClient.left;
int y = MulDiv (-ry, rectClient.Height(), 150000) + rectClient.bottom;
If speed is an issue, the latter version is probably preferrable. The floating point unit in our modern processors is lightning fast. BUT: The conversion between integer and floating point and back and particular any rounding is a relatively slow operation. So one is well advised to stay in the integer or the floating point world whenever possible and avoid cross overs.