How do I draw a shape with a hole in it?
How do I draw a blue square with a transparent round hole in the middle as shown below using Delphi and Firemonkey?
I want to do something like this:
But I can't find a way to make the circle transparent :(
+3
user8372521
source
to share
1 answer
Something like this should do it:
var lPath: TPathData;
begin
lPath := TPathData.Create;
lPath.AddRectangle(RectF(0,0,100,100), 0,0, []);
lPath.AddEllipse(RectF(20,20,80,80));
Canvas.Fill.Color := $FF8080FF;
Canvas.FillPath(lPath,1);
lPath.Free;
end;
+3
Hans
source
to share