Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_Paths🞂TCanvas32🞂BrushesProperty

TCanvas32.Brushes

Read-only collection of vector stroke and fill brushes applied during path rendering.

Declaration ​

pascal
property Brushes: TBrushCollection read FBrushes;

Description ​

Brushes returns the TBrushCollection instance managed by TCanvas32.

When rendering paths, TCanvas32 iterates through visible brushes in Brushes and executes their rendering pass (PolyPolygonFS or PolyPolygonMixedFS) on the polygon renderer.

Brushes added to Brushes can include:

Example ​

pascal
var
  Canvas: TCanvas32;
  FillBrush: TSolidBrush;
  StrokeBrush: TStrokeBrush;
begin
  Canvas := TCanvas32.Create(MyBitmap);
  try
    // Add solid fill brush
    FillBrush := TSolidBrush(Canvas.Brushes.Add(TSolidBrush));
    FillBrush.FillColor := clBlue32;

    // Add stroke outline brush
    StrokeBrush := TStrokeBrush(Canvas.Brushes.Add(TStrokeBrush));
    StrokeBrush.FillColor := clBlack32;
    StrokeBrush.StrokeWidth := 2.0;

    // Draw shape with both fill and stroke
    Canvas.RoundRect(FloatRect(20.0, 20.0, 180.0, 120.0), 10.0);
  finally
    Canvas.Free;
  end;
end;