Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 04:37:18 +0000



Post From: Forcing lines to have square edges

[2018-01-12 09:16:32]
gomifromparis - Posts: 244
Default GDI lines have rounded edges by default. It gives unpleasant artefacts on 2 pixel width lines (see attached pic of the order lines on a chart)

I've had this issue on my custom studies for some time, finally decided to tackle it. Dunno if you're interested, but here's how you can force square edges.

LOGBRUSH LogBrush;
LogBrush.lbStyle = BS_SOLID;
LogBrush.lbColor = sc.Subgraph[0].PrimaryColor;
LogBrush.lbHatch = NULL;

hLinePen = ExtCreatePen(PS_GEOMETRIC| PS_SOLID| PS_ENDCAP_SQUARE, sc.Subgraph[0].LineWidth, &LogBrush, sc.Subgraph[0].LineStyle,NULL);
Date Time Of Last Edit: 2018-01-12 09:36:20
imagesquareedges.png / V - Attached On 2018-01-12 09:36:17 UTC - Size: 2.78 KB - 255 views