DrawPolygon

procedure DrawPolygon(img: TImage32; const polygon: TArrayOfPointD; fillRule: TFillRule; color: TColor32); overload;

procedure DrawPolygon(img: TImage32; const polygon: TArrayOfPointD; fillRule: TFillRule; renderer: TCustomRenderer); overload;

procedure DrawPolygon(img: TImage32; const polygons: TArrayOfArrayOfPointD; fillRule: TFillRule; color: TColor32); overload;

procedure DrawPolygon(img: TImage32; const polygons: TArrayOfArrayOfPointD; fillRule: TFillRule; renderer: TCustomRenderer); overload;


Example 1
  uses Image32, Image32_PNG, Image32_vector, Image32_Draw;
  ...
  var
    img: TImage32;
    path: TArrayOfPointD;
    rec: TRect;
  begin
    img := TImage32.Create(256,256);
    rec := img.Bounds;
    Windows.InflateRect(rec, -8,-8);
    path := Pie(rec, angle15, -angle15);
    
    //start with a drop shadow
    DrawShadow(img, path, frNonZero, 8);
    //draw the polygon
    DrawPolygon(img, path, frNonZero, $FF00DD00);
    //and add a 3D button effect
    Draw3D(img, path, frNonZero, 10,6);
    //finish with a solid green outline
    DrawLine(img, path, 5, clGreen32, esClosed);

    img.SaveToFile('pie.png');
    img.Free;
  end;
            

Example 2
uses Image32, Image32_PNG, Image32_vector, Image32_Draw;
  ...
var
  img: TImage32;
  rec: TRect;
  path: TArrayOfPointD;
  imageRenderer: TImageRenderer;
begin
  img := TImage32.Create(256,256);
  rec := Rect(6,6, 250,250);
  path := Ellipse(rec);
  imageRenderer := TImageRenderer.Create(tfsRotate180);
  imageRenderer.Image.LoadFromResource('TILE', 'BMP');
  imageRenderer.Image.Resize(20,20);
  DrawPolygon(img, path, frEvenOdd, imageRenderer);
  DrawLine(img, path, 6, clNavy32, esClosed);
  img.SaveToFile('tiled_ellipse.png');
  imageRenderer.Free;  
  img.Free;
end;
            

Example 3
  uses Image32, Image32_PNG, Image32_vector, Image32_Draw;
  ...
  var
    img: TImage32;
    path: TArrayOfPointD;
    rec: TRect;
    radGradRend: TRadialGradientRenderer;
  begin
    img := TImage32.Create(256,256);
    rec := img.Bounds;
    Windows.InflateRect(rec, -3,-3);
    path := Pie(rec, angle15, -angle15);
    
    //setup the gradient colors
    radGradRend := TRadialGradientRenderer.Create;
    radGradRend.SetParameters(rec, clFuchsia32, clBlue32);
    radGradRend.InsertColorStop(0.3, clRed32);
    radGradRend.InsertColorStop(0.4, clYellow32);
    radGradRend.InsertColorStop(0.5, clYellow32);
    radGradRend.InsertColorStop(0.7, clLime32);
    radGradRend.InsertColorStop(0.8, clAqua32);
    //do the drawing
    DrawPolygon(img, path, frNonZero, radGradRend);
    DrawLine(img, path, 5, clMaroon32, esClosed);

    img.SaveToFile('pie3.png');
    radGradRend.Free;
    img.Free;
  end;