RAD Studio
ContentsIndex
PreviousUpNext
Changing the Brush Color

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;
}
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!