FMX.Graphics.TCanvas.SaveState

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SaveState: TCanvasSaveState;

C++

TCanvasSaveState* __fastcall SaveState();

Properties

Type Visibility Source Unit Parent
function public
FMX.Graphics.pas
FMX.Graphics.hpp
FMX.Graphics TCanvas

Description

Saves the current drawing and filling properties of the TCanvas.

SaveState is implemented by TCanvas descendants to save the current state of the TCanvas. The properties are saved to be restored later.

Call SaveState to save the drawing and filling properties in different moments of the drawing process.

SaveState returns a TCanvasSaveState object.

To restore the saved states, call RestoreState.

var
  MyCanvas: TCanvas;
  Save: TCanvasSaveState;

begin
  Save := MyCanvas.SaveState;
  { properties customization }
  { code block }
  MyCanvas.RestoreState(Save);
end;

See Also

Code Example