I have played with Delphi 11 + FMX and I'm trying to draw on a Trectangle but 'shape.repaint' clears the canvas. Is there a way to save the already drawn pattern on canvas and add something to it later?
I've used Lazarus before and in it onpaint doesn't clear the canvas.
procedure TForm2.Button1Click(Sender: TObject);
begin
x:=random(100);
rectangle1.Repaint;
end;
procedure TForm2.Rectangle1Paint(Sender: TObject; Canvas: TCanvas;
const ARect: TRectF);
var
rect:TRectF;
begin
rect:=TRectF.Create(100-x,100-x,100+x,100+x);
canvas.Stroke.Color:=TAlphaColors.Black;
canvas.DrawEllipse(rect,255);
end;