Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-04

How can I Backup and restore TCanvas class

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

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

Reply by email

Mattias Gaertner
to FreeMan
Show quoted text 16 lines
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

Reply by email

FreeMan
to Mattias Gaertner

This is RxGrid and I'm tring add OnRxColumnFooterDraw Tnotify event

I sent out "Canvas" so programmer can change any info. background color, font etc. Sent Canvas to out, better then one by one (Bursh, Pen bla bla) I'm looking for short code for change original rxcodes. last chance sent to out Brush and font

16-04-2014 15:40 tarihinde, Mattias Gaertner yazd?:

Show quoted text 14 lines
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

Reply by email