Delphi drawing a smooth pie
<p>Does anyone have a code for drawing a smooth pie on a canvas in Delphi? </p>

<p>All I could find on the web are examples of smooth lines but that does not help me much...
Also I considered Gr32, but for what I need, it adds a pretty big footprint to my app.
I just need to draw a filled pie on a canvas that does not look so awful as it does with the default </p>

<pre><code>Canvas.Pie(X1, Y1, X2, Y2, X3, Y3, X4, Y4);
</code></pre>

<p>I use Delphi XE, so no Firemonkey...</p>

<p><strong>EDIT</strong>
<a href="https://i.stack.imgur.com/XNKwK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XNKwK.jpg" alt="enter image description here"></a></p>

<p>The pie on the left is obtained following your recommendation @johan using the following code:</p>

<pre><code>procedure TForm1.Button4Click(Sender: TObject);
var
    Center:TPoint;
    Radius:integer;
    Bmp: TBitmap;
    MF: TMetaFile;
    MetafileCanvas: TMetafileCanvas;
begin
  MF := TMetaFile.Create;
  MF.Width := 150;
  MF.Height := 150;

  MetafileCanvas := TMetafileCanvas.Create(MF, 0);
  MetafileCanvas.Pen.Color := clRed;
  MetafileCanvas.Brush.Color := clRed;
  MetafileCanvas.Brush.Style := bsSolid;
  MetafileCanvas.Pie(0,0,150, 150, 150,50, 150,50);

  MetafileCanvas.Free;

  Bmp := Gdip.DrawAntiAliased(MF);
  Image2.Picture.Assign(Bmp);
  Bmp.Free;
  MF.Free;
end;
</code></pre>

<p>Thanks</p>