Clears the drawing area to the specified solid color brush.
public void Clear(SolidColorBrush brush)
Public Sub Clear( _ByVal brush As SolidColorBrush _)
public:void Clear(SolidColorBrush^ brush)
brush
The solid color brush to which the drawing area is cleared.
If the rendering target has an active clip (specified by PushClip), the clear command is applied only to the area within the clipping region.
Imports Leadtools.Windows.D2DRenderingPublic Sub D2DSurfacePushLayerExample()'Create a new instance of a 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 an ellipse geometryDim ellipse As EllipseGeometry = New EllipseGeometry()ellipse.Center = New Point(500, 500)ellipse.RadiusX = 100ellipse.RadiusY = 100Dim geomeTryGroup As GeometryGroup = New GeometryGroup()geomeTryGroup.Children.Add(ellipse)'Push the geometry object to receive all subsequent drawing operationsd2dSurface.PushLayer(geomeTryGroup)'Create a rectangle having 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 SolidColorBrush = New SolidColorBrush(Colors.Green)'Clear the pushed Layer with the fill brushd2dSurface.Clear(fill)'Stop redirecting drawing operations to the layerd2dSurface.PopLayer()'Restore the surface drawing stated2dSurface.Restore(drawingState)'End the Draw operation and invalidate the surfaced2dSurface.EndDraw()d2dSurface.Invalidate(System.Windows.Rect.Empty)End Sub
using Leadtools.Windows.D2DRendering;public void D2DSurfacePushLayerExample(){//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 an ellipse geometryEllipseGeometry ellipse = new EllipseGeometry();ellipse.Center = new Point(500, 500);ellipse.RadiusX = 100;ellipse.RadiusY = 100;GeometryGroup geometryGroup = new GeometryGroup();geometryGroup.Children.Add(ellipse);//Push geometry to receive all subsequent drawing operationsd2dSurface.PushLayer(geometryGroup);//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 brushSolidColorBrush fill = new SolidColorBrush(Colors.Green);//Clear the pushed Layer with the fill brushd2dSurface.Clear(fill);//Stop redirecting drawing operations to the layerd2dSurface.PopLayer();//Restore the surface drawing stated2dSurface.Restore(drawingState);//End the Draw operation and invalidate the surfaced2dSurface.EndDraw();d2dSurface.Invalidate(Rect.Empty);}
|
Products |
Support |
Feedback: Clear Method - Leadtools.Windows.D2DRendering |
Introduction |
Help Version 19.0.2017.3.21
|

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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.