C#
VB
C++
Saves the current drawing state.
public D2DDrawingState Save() Public Function Save() As Leadtools.Windows.D2drendering.D2DDrawingState
public:Leadtools.Windows.D2drendering.D2DDrawingState^ Save();
The current drawing state block of D2DSurface.
using Leadtools.Windows.D2DRendering;public void D2DSurfaceExample(){//Create a new instance of the D2DSurface objectD2DSurface d2dSurface = new D2DSurface();//Set the surface Sized2dSurface.SurfaceSize = new Size(1000, 1000);//Pass an empty rect to redraw the entire surfaced2dSurface.BeginDraw(Rect.Empty);//Save the surface drawing stateD2DDrawingState drawingState = d2dSurface.Save();//Create a rect having the specified dimensionsRect rect = new Rect(40, 40, 500, 200);//Create a new instance of a brush from a new solid color brushBrush fill = new SolidColorBrush(Colors.Green);//Fill the interior of the specified rectangle using the specified brushd2dSurface.FillRectangle(fill, rect);//Create a new instance of the D2DPen objectD2DPen pen = new D2DPen(new SolidColorBrush(Colors.Red), 2);//Draw an outline using the specified rectangle and D2DPend2dSurface.DrawRectangle(pen, rect);//Restore the surface drawing stated2dSurface.Restore(drawingState);//End the Draw operation and invalidate the surfaced2dSurface.EndDraw();d2dSurface.Invalidate(Rect.Empty);}
Imports Leadtools.Windows.D2DRenderingPublic Sub D2DSurfaceExample()'Create new instance of D2DSurfaceDim d2dSurface As D2DSurface = New D2DSurface()'Set the surface Sized2dSurface.SurfaceSize = New Size(1000, 1000)'Pass an empty rectangle to redraw the whole surfaced2dSurface.BeginDraw(System.Windows.Rect.Empty)'Save the surface drawing stateDim drawingState As D2DDrawingState = d2dSurface.Save()'Create a rectangle with the specified dimensionsDim rect As Rect = New Rect(40, 40, 500, 200)'Create a new instance of a brush from a new solid color brushDim fill As Brush = New SolidColorBrush(Colors.Green)'Fill the interior of the specified rectangle using the specified brushd2dSurface.FillRectangle(fill, rect)'Create a new instance of D2DPenDim pen As D2DPen = New D2DPen(New SolidColorBrush(Colors.Red), 2)'Draw an Outline of the specified rectangle using the D2DPend2dSurface.DrawRectangle(pen, rect)'Restore the surface drawing stated2dSurface.Restore(drawingState)'End the Draw operation and invalidate the surfaced2dSurface.EndDraw()d2dSurface.Invalidate(System.Windows.Rect.Empty)End Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
