TCustomTeePanel.SetBrushCanvas
 
 
 

All Units  All Classes  Properties, Methods and Events  

TCustomTeePanel.SetBrushCanvas
TCustomTeePanel

procedure SetBrushCanvas(aColor: TColor; Const ABrush: TChartBrush; ABackColor: TColor);

Unit
TeeProcs

Description
The SetBrushCanvas method solves an annoying problem with standard behaviour. The VCL automatically sets the Windows GDI background mode to TRANSPARENT when the Brush.Style property is set to a different Brush style than bsSolid. This means all filled Screen parts should be erased previous to apply the transparent brush. This method calls the Windows GDI API directly to set the Windows Brush mode to OPAQUE and Windows Brush Background Color to ABackColor parameter. Use this method when you want to draw non solid patterns that need to be OPAQUE (erasing existing pixels before filling).

Example
:

We want to custom draw a rectangle filled with White color and a Vertical pattern Brush of Red color.
The rectangle will cover all Chart screen space between Axis.

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
Chart1.Walls.Back.Brush.Style:=bsDiagCross;

// Chart1.Canvas.AssignBrush(Chart1.Walls.Back.Brush, clRed, clWhite);

Chart1.SetBrushCanvas(clRed, Chart1.Walls.Back.Brush, clWhite);

Chart1.Canvas.Rectangle(Chart1.ChartRect);
end;


See also: Equivalent Canvas AssignBrush method.



Send us Help Feedback. Copyright 1995-2013 © by Steema Software. All Rights Reserved.