[Libreoffice] DrawPolyLine on Windows

Dmitry. A. Ashkadov dmitry.ashkadov at gmail.com
Tue Aug 23 15:09:00 PDT 2011


23.08.2011 19:06, Tor Lillqvist пишет:
>> I tried to draw polyline.... But on Windows... the end point is not drawn...
> I am not saying your patch is not useful, but just out of interest, how do you interpret the word "point" in the GDI documentation for LineTo()? Does it in fact simply mean "pixel"? But what if the current pen is wider than one pixel? Or is the vagueness intentional and any expectation of pixel-perect repeatable results with different graphics devices and drivers is futile?
>
> Compared to how strictly mathematically X11 graphics is defined for wide lines, the GDI "specification" is just horrible.
>
> --tml
>
Hello, Tor!

Very good questions!

I think «point» means «pixel». Line as an object is described in MSDN 
only for «raster» devices (pixels on screen or dots on paper). Moreover 
word «point» is used as set of parameters (x and y coordinated) for 
function. Maybe I'm wrong, but in case of continuous space (maybe vector 
graphics) we have line without end point (open line at its end) that 
causes problem when we try to show such line on raster device. Should we 
draw last pixel or not? it contains both an end of line and an end 
point. I don't know how this function [LineTo()] may be used to create a 
continuous line. Windows metafile seems as packed script, it doesn't 
represent a really vector graphics format.
In case of wider pen, another overloaded function «drawPolyLine()» is 
called that uses GDI+ or thick lines is represented as polygons. So, for 
thick lines my solution [patch] doesn't work and no additional pixel is 
drawn (patch doesn't break drawing thick lines). Moreover I tried to 
draw thick polyline. the thick polylines on Windows and on Linux are the 
same.


-- 
Best Regards,
     Dmitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmitry_ashkadov.vcf
Type: text/x-vcard
Size: 155 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110824/7b31ab9b/attachment.vcf>


More information about the LibreOffice mailing list