[Lazarus] How can I Backup and restore TCanvas class

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Apr 16 14:40:47 CEST 2014


On Wed, 16 Apr 2014 15:21:35 +0300
FreeMan <freeman35 at delphiturkiye.com> wrote:

> Hello,
> I need backup active canvas, and when drawing and other codes finished, 
> restore Canvas back. For this code, assign pointer just so
> Canvas.Brush.Color := clRed; change ACanvas.Brush.Color too.
> How can I Backup and restore TCanvas class ?
> Regards
> 
>    ACanvas := Canvas;//Backup canvas info
> 
>     AText := C.Footer.DisplayText;
>     OnRxColumnFooterDraw(Self, Canvas, R, C, AText);
>     Canvas.FillRect(R);
>     DrawCellGrid(i, 0, R, []);
>     DrawCellText(i, 0, R, [], AText);
> 
>   Canvas:=ACanvas;//Restore canvas info

What parts do you want to restore?
Brush, Pen, Font, Handle state, pixels?

Mattias




More information about the Lazarus mailing list