Changing the Brush Color

From RAD Studio
Jump to: navigation, search

Go Up to Using Brushes


A brush's color determines what color the canvas uses to fill shapes. To change the fill color, assign a value to the brush's Color property. Brush is used for background color in text and line drawing so you typically set the background color property.

You can set the brush color just as you do the pen color, in response to a click on a color grid on the brush's toolbar :

procedure TForm1.BrushColorClick(Sender: TObject);
begin
  Canvas.Brush.Color := BrushColor.ForegroundColor;
end;
void __fastcall TForm1::BrushColorClick(TObject *Sender) {
    Canvas->Brush->Color = BrushColor->BackgroundColor;
}

See Also