Hi,
Is there a way to prevent drawing outside the canvas?
If, for example, I have a rectangular shape on which I draw an ellipse and I want to limit the drawing to the area of the shape.
procedure TForm1.shapePaint(Sender: TObject; Canvas: TCanvas;
const ARect: TRectF);
var
x,y :integer;
circle : TRectF;
begin
x:=round(shape.Width/2);
y:=round(shape.Width/2);
circle:=TRectF.Create(x-190,y-190,x+100,y+100);
shape.Canvas.Stroke.Color:=TAlphaColors.Black;
shape.Canvas.DrawEllipse(circle,50);
end;
Now part of it is also drawn outside the shape.