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

# TLazCanvas.DoCopyRect

Performs actions needed to copy a source rectangle from the specified canvas.

## Declaration

Source position: lazcanvas.pas line 113

`protected procedure TLazCanvas.DoCopyRect(`
`x: Integer;`
`y: Integer;`
`canvas: TFPCustomCanvas;`
`const SourceRect: TRect`
`); override;`

## Arguments

`x` |  | Left coordinate where the copied values are stored on the Lazarus canvas.
`y` |  | Top coordinate where the copied values are stored on the Lazarus canvas.
`canvas` |  | Canvas instance that is the source for the values copied in the method.
`SourceRect` |  | TRect instance with the Canvas coordinates copied in the method.

## Description

DoCopyRect is an overridden method in TLazCanvas. It is used to copy values from the specified source rectangle in the Canvas argument to the location specified in X and Y. DoCopyRect reimplements the method from an ancestor class (TFPPixelCanvas).

X and Y contain the left, top coordinates on the Lazarus canvas where the copied values are stored.

Canvas is the TFPCustomCanvas instance with the values for the SourceRect argument.

SourceRect is the TRect instance width the Left, Top, Right and Bottom coordinates for the rectangular region copied from Canvas.

DoCopyRect calls the CanvasCopyRect method to perform the actions needed to perform the copy operation using the specified arguments.

## See also

TLazCanvas.CanvasCopyRect |  | Copies the contents of a supported image format in ASource to the canvas.