xtd 0.2.0
Loading...
Searching...
No Matches

◆ save()

xtd::drawing::drawing_2d::graphics_state xtd::drawing::graphics::save ( )

Saves the current state of this xtd::drawing::graphics and identifies the saved state with a xtd::drawing::drawing_2d::graphics_state.

Returns
This method returns a xtd::drawing::drawing_2d::graphics_state that represents the saved state of this xtd::drawing::graphics.
Remarks
When you call the xtd::drawing::graphics::save method of a xtd::drawing::graphics, an information block that holds the state of the xtd::drawing::graphics is put on a stack. The xtd::drawing::graphics::save method returns a xtd::drawing::drawing_2d::graphics_state that identifies that information block. When you pass the identifying xtd::drawing::drawing_2d::graphics_state to the xtd::drawing::graphics::restore method, the information block is removed from the stack and is used to restore the xtd::drawing::graphics to the state it was in at the time of the xtd::drawing::graphics::save method call. Note that the xtd::drawing::drawing_2d::graphics_state returned by a given call to the Save method can be passed only once to the xtd::drawing::graphics::restore method.
Calls to the xtd::drawing::graphics::save method can be nested; that is, you can call the xtd::drawing::graphics::save method several times before you call the xtd::drawing::graphics::restore method. Each time you call the xtd::drawing::graphics::save method, an information block is put on the stack, and you receive a xtd::drawing::drawing_2d::graphics_state for the information block. When you pass one of those objects to the xtd::drawing::graphics::restore method, the xtd::drawing::graphics is returned to the state it was in at the time of the xtd::drawing::graphics::save method call that returned that particular xtd::drawing::drawing_2d::graphics_state. The information block placed on the stack by thatxtd::drawing::graphics::sSave method call is removed from the stack, and all information blocks placed on that stack after that xtd::drawing::graphics::save method call are also removed.