开发者

GDI polyline partial output when printing

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 th开发者_如何学Goe 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.


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?

http://books.google.com/books?id=-O92IIF1Bj4C&lpg=PA359&ots=Sw0FC-9lk7&dq=gdi%2016%20bit%20coordinates&pg=PA359#v=onepage&q=gdi%2016%20bit%20coordinates&f=false


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜