Setting line styles for Canvas.LineTo

Can I set the line style for the TCanvas.LineTo method? It seems that by default, rounded ends that look very bad for several lines in a row of different colors when Pen.Width is set to a large value (like 9).

It looks like this (rounded ends):

 ********........******
**********........******
**********........******
 ********........******

(where *, for example, blue and yellow)

Even worse, if two outer lines are drawn along the midline:

 ********........******
**********......********
**********......********
 ********........******

I would like it to look (outlines):

 ********........******
 ********........******
 ********........******
 ********........******

The pen does not seem to offer any settings for this, and the LineTo method does not apply. Perhaps there is a windows API function that I could name?

+3
source share
2 answers

ExtCreatePen . PS_ENDCAP_* PS_JOIN_*.

+5

, Delphi, , Windows API LineTo ( linecap - ).

, / , .

OpenGL linedrawing, glLineWidth , / , :

........            .........
..xxxxx.            ..x......            
.xxxxx.. OpenGL way .xxx..... correct way (not quite exact, I hope you get it)
xxxxx...            xxxxx.... 
xxxx....            xxxx.....
0

All Articles