How to use FireMonkey TCanvas.DrawXXX methods? [duplicate]

  

This question already has an answer here:

Firemonkey TControl subclass cannot draw on component

1 answer

I try to create a form with a custom visualisation, but I can’t get the simplest drawing methods of TCanvas to work. In the following example, I can see only the filled rectangle, but no line and no arc:

procedure TEditorPanel.FormPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF);
var
center, radius: TPointF;
rect: TRectF;
begin
with Canvas do
begin
Fill.Color := TAlphaColors.White;
FillRect(RectF(0, 0, Width, Height), 0, 0, AllCorners, 1);

center := PointF(200, 200);
radius := PointF(40, 40);

Stroke.Color := TAlphaColors.Red;
Fill.Color := TAlphaColors.Blue;
DrawLine(center, radius, 1);
DrawArc(center, radius, 0, 90, 1);

rect := RectF(10, 10, 100, 100);
FillRect(rect, 0, 0, AllCorners, 100);
end;
end;

What am I missing?

Comments are closed.