Hi.
As in topic Stroke not working when width > 1 , the same happens using a TTMSFNCHTMLText
(tested on a VCL Form). If Stroke.Width
> 1, it shows a continuous line, ignoring the selected Stroke.Kind
.
Same behaviour using a TTMSFNCImage
. Maybe there are other affected FNC components.
Hi,
Unfortunately in VCL (GDI), the stroke kind dash / dot can only be applied when the stroke width is 1. It's a technical limitation. Please see this example.
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
PaintBox1.Canvas.Pen.Style := psDot;
PaintBox1.Canvas.Pen.Width := 4;
PaintBox1.Canvas.Pen.Color := clRed;
PaintBox1.Canvas.MoveTo(0, 0);
PaintBox1.Canvas.LineTo(PaintBox1.Width, PaintBox1.Height);
end;
Which has the same outcome.
Not all components expose NativeCanvas as this automatically switches all drawing to GDI+. If it's important to have thick dotted/dashed borders then use protected class wrappers:
type
TTMSFNCHTMLTextOpen = class(TTMSFNCHTMLText);
TTMSFNCHTMLTextOpen(TMSFNCHTMLText1).NativeCanvas := True;