Copies part of an image from another canvas into the canvas.
procedure CopyRect(const Dest: TRect; Canvas: TCanvas; const Source: TRect);
Description
Use CopyRect to transfer part of the image on another canvas to the image of the TCanvas object. Dest specifies the rectangle on the canvas where the source image will be copied. The Canvas parameter specifies the canvas with the source image. Source specifies a rectangle bounding the portion of the source canvas that will be copied.
The portion of the source canvas is copied using the mode specified by CopyMode.
==========================
The following code illustrates the differences between CopyRect and BrushCopy. The bitmap graphic TARTAN.BMP is loaded into Bitmap and displayed on the Canvas of Form1. BrushCopy replaces the color black in the graphic with the brush of the canvas, while CopyRect leaves the colors intact.
var
Bitmap: TBitmap;
MyRect, MyOther: TRect;
begin
MyRect := Rect(10,10,100,100);
MyOther := Rect(10,111,100, 201);
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('c:/windows/tartan.bmp');
Form1.Canvas.BrushCopy(MyRect, Bitmap, MyRect, clBlack);
Form1.Canvas.CopyRect(MyOther,Bitmap.Canvas,MyRect);
Bitmap.Free;
end;