If you are running on Win9x, you are running on a toy 16-bit OS, a
warmed-over Windows 3.1 GDI that was designed for the 8088. Your
scaling requires more than 16 bits of precision, and you are seeing
the truncation effects of the high-order 16 bits being discarded.
There are two solutions: scale it yourself so the only coordinates you
send to GDI fit in the 16-bit range, or move to a real operating
system with 32-bit GDI coordinates.
joe
On Mon, 6 Mar 2000 15:53:15 -0700, "Phil McAdams"
Quote:
>I have a question about how windows clips line segments using the
>CDC::LineTo() function. I'm drawing some mapping coordinates which get
>converted from a latitude/longitude coordinate to a pixel coordinate. I
>then draw lines between the points.
>Depending upon how close in the user has zoomed in, the point to which I
>need to draw may be way off the screen. Windows seems to handle this OK up
>to some undefined point but beyond that it starts drawing stray lines all
>over the place. For example, if I'm drawing from pixel location (100, 100)
>to a pixel location (5000, 5000) which is off the screen, Windows does a
>fine job at drawing the line and clipping it at the window's boundary. But
>if I try to draw to a pixel location much farther off the screen, say
>(1000000, 1000000) then it starts drawing weird lines everywhere.
>If I knew the maximum limit to which Windows to correct draw to offscreen
>points then I could filter out points that are beyond that limit. Does
>anybody know what the limit is?
>Phil McAdams
Joseph M. Newcomer [MVP]
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm