Why does TPen not draw dotted lines? lazarus / 39-Graphics ---------------------------------------------------------------------- eny · 2015-07-22 11:47 When setting the style of Canvas.Pen to psDot, no dotted lines are drawn but dashed ones. The 2nd line from the bottom is supposed to be a dotted line, but it is a dashed line. Only setting Cosmetic to false (bottom line) gives the expected result. Example:Code: [Select]  pbox.Canvas.Pen.Style := psSolid;                                  pBox.Canvas.Line(10,10,100,10);   pbox.Canvas.Pen.Style := psDash;                                     pBox.Canvas.Line(10,20,100,20);   pbox.Canvas.Pen.Style := psDot;                                    pBox.Canvas.Line(10,30,100,30);   pbox.Canvas.Pen.Style := psDot;   pbox.Canvas.Pen.Cosmetic := false; pBox.Canvas.Line(10,40,100,40); This seems in contradiction with what is documented: "Cosmetic is to draw 1-pixel wide lines fast" LCL bug? Underlying (Win-) API bug? By design? ---------------------------------------------------------------------- rvk · 2015-07-22 13:39 Quote from: eny on July 22, 2015, 01:47:38 pmLCL bug? Underlying (Win-) API bug? By design? A known WinAPI bug? http://stackoverflow.com/questions/541166/winapi-how-to-draw-dotted- line http://www.experts- exchange.com/Programming/Microsoft_Development/Q_10152035.html ---------------------------------------------------------------------- eny · 2015-07-22 14:25 Quote from: rvk on July 22, 2015, 03:39:47 pmA known WinAPI bug? http://stackoverflow.com/questions/541166/winapi-how-to-draw-dotted- line Already saw that and many other examples with more or less the same solution. Creating a new pen does not work; the dotted line will be a 3-dot dashed line except when Cosmetic is set to false. In that case the example I gave already works. >> http://www.experts- exchange.com/Programming/Microsoft_Development/Q_10152035.html Hardly anybody uses EE anymore after they started selling content given to them for free by volunteers... ---------------------------------------------------------------------- rvk · 2015-07-22 14:51 Quote from: eny on July 22, 2015, 04:25:58 pm>> http://www.experts- exchange.com/Programming/Microsoft_Development/Q_10152035.html Hardly anybody uses EE anymore after they started selling content given to them for free by volunteers... I know. But they still come up in Google a lot. I haven't got a subscription (and never had). With script blockers they still show content/answers if gone through Google. (but clicking the link here I see it doesn't)