[Overview][Types][Classes][Index] | Reference for unit 'LazCanvas' (#lcl)

# TLazCanvas.DoRectangleFill

Adjusts the FCL image rectangle to be LCL compatible and draws a filled rectangle on the canvas.

## Declaration

Source position: lazcanvas.pas line 106

`protected procedure TLazCanvas.DoRectangleFill(`
`const Bounds: TRect`
`); override;`

## Arguments

`Bounds` |  | Rectangle with the bounds adjusted and used in the method.

## Description

DoRectangleFill adjusts the fcl-image coordinate system to be compatible with coordinates used in TCanvas.

It calls the FCL SortRec routine (in clipping.pp) to normalize the values in Bounds prior to the drawing operation. It also shrinks the rectangle by a single pixel on the bottom and right edges for the border drawn in the Rectangle method. The original values in Bounds are not changed though - a temporary copy of Bounds is used in the method.

Values in Brush, like the Color and Style properties, are used to draw the filled rectangle. Style determines the routine(s) called to fill the drawing area as follows:

bsSolid
  Fills the specified area with the Brush color. If the rectangle covers the entire width and height for the canvas and Clipping is not enabled, the FillColor method is used. Otherwise, the FillRectangleColor method is called using the adjusted bounds for the canvas.
bsPattern
  Calls FillRectanglePattern to fill the rectangle with the pattern specified for the Brush.
bsImage
  Fills the rectangle with the image assigned to the Brush. Uses RelativeBrushImage to determine whether FillRectangleImageRel or FillRectangleImage is called for the operation. A PixelCanvasException exception is raised for the style if an image has not been assigned in Brush.
bsBDiagonal
  Calls FillRectangleHashDiagonal to fill the rectangle using the size for the hash pattern.
bsFDiagonal
  Calls FillRectangleHashBackDiagonal to fill the rectangle using the size for the hash pattern.
bsCross
  Calls both FillRectangleHashHorizontal and FillRectangleHashVertical to fill the rectangle using the size for the hash pattern.
bsDiagCross
  Calls booth FillRectangleHashDiagonal and FillRectangleHashBackDiagonal to fill the rectangle using the size for the hash pattern.
bsHorizontal
  Calls FillRectangleHashHorizontal to fill the rectangle using the size for the hash pattern.
bsVertical
  Calls FillRectangleHashVertical to fill the rectangle using the size for the hash pattern.

DoRectangleFill is an overridden method in TLazCanvas. It reimplements the method introduced in the TFPPixelCanvas ancestor (in FCL), and does not call the inherited method.