Take the 2-minute tour ×

I'm seeing a strange problem when calling Win32 GDI Polyline() when printing out. On screen it all looks ok, however if printing it will stop the polyline when it encounters a large value. I think this discrepency is due to the scaling for printing yielding larger POINT values.

It appears as if the polyline stops drawing if it hits a value > 32767, ie, as if there is a 16 bit limit on the POINT values.

I've seen some hear-say online about 16 bit values however no definitive reasoning. I would like to find out why this is occuring before thinking about a potential solution.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

According to MS documentation, this would occur in Windows 9X, where the coordinates are 32-bit but the underlying implementation is 16-bit and the values are just truncated. In practice, I already had the same problem years ago in non-9X Windows versions, but the situation was a bit different from yours, I believe. My "big" coordinates weren't there because the DC resolution was high, but because I had lines with one end inside the screen and the other far away outside - and the behaviour was that the visible part would not intercept the screen edge at the right point. In my case I solved the problem by clipping the lines before drawing. Maybe your problem is a bug in the specific printer driver you're using, have you tried to use another one?


share|improve this answer
Actually the problem that you are describing is exactly what I'm doing as well. I'm drawing a point that is actually off-screen. With screen resolution it is under 16bit boundary but when printing it isn't. I'll be clipping the region prior to display / printing - code I inherited ;) –  geekboyUK Apr 1 '10 at 16:17
add comment

Yes, the old 16-bit Windows 3.x maximum value on coordinates is still around in scattered unobvious places. In this case it is very likely to be your printer driver. If a driver upgrade doesn't fix it, there's not much you can do but scale the polyline yourself.

share|improve this answer
add comment

Your Answer


