Restores the current transformations, clipping region, and quality settings of the canvas to a saved state.
RestoreCurrentState restores a previous saved state of the canvas.
Call RestoreCurrentState to restore the drawing and filling properties (excluding the Stroke, Fill, and Font properties) to values saved in previous moments of the drawing process.
The State parameter specifies the pointer to the saved data. After the state is restored, the saved data are freed. If State is empty, RestoreCurrentState raises an exception.
To save the canvas state, call
SaveCurrentState.
Namespace: RSGdiPlusGraphics
Delphi |
public |
Parameters
State
Type: System.Void
When you call the SaveCurrentState method, an information block that holds the state of the GDI+ Graphics object (which the TRSGPCanvas encapsulates) is put on a stack. Note that the Canvas properties Fill/Brush, Stroke/Pen, Font, and StringFormat are not saved. The method returns a value that identifies that information block. When you pass the identifying value to the RestoreCurrentState method, the information block is removed from the stack and is used to restore the GDI+ Graphics object to the state it was in at the time of the SaveCurrentState call. Note that the identifier returned by a given call to the SaveCurrentState method can be passed only once to the RestoreCurrentState method. Calls to the SaveCurrentState method can be nested; that is, you can call the SaveCurrentState method several times before you call the RestoreCurrentState method. Each time you call the SaveCurrentState method, an information block is put on the stack, and you receive an identifier for the information block. When you pass one of those identifiers to the RestoreCurrentState method, the GDI+ Graphics object is returned to the state it was in at the time of the SaveCurrentState call that returned that particular identifier (excluding Fill, Stroke, and Font properties). The information block placed on the stack by that SaveCurrentState call is removed from the stack, and all information blocks placed on that stack after that SaveCurrentState call are also removed. |