RAD Studio |  |

Changing the Brush Color
See Also
Collapse All

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 :

Copy Code

    procedure TForm1.BrushColorClick(Sender: TObject);
    begin
    Canvas.Brush.Color := BrushColor.ForegroundColor;
    end;

Copy Code

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

See Also

Changing the Brush Style

Setting the Brush Bitmap Property

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!