GraphicsPath::ClearMarkers Method ()
.NET Framework (current version)
Clears all markers from this path.
Assembly: System.Drawing (in System.Drawing.dll)
Use the SetMarkers method to create a marker at the current location in a GraphicsPath. Use the NextMarker method to iterate through the existing markers in a path.
Markers are used to separate groups of subpaths. One or more subpaths can be contained between two markers.
The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, an OnPaint event object. The code performs the following actions:
Creates a path.
Adds several objects to the path.
Adds markers to the path.
Clears all markers from the path.
Draws the path to the screen.
private: void ClearMarkersExample( PaintEventArgs^ e ) { // Set several markers in a path. GraphicsPath^ myPath = gcnew GraphicsPath; myPath->AddEllipse( 0, 0, 100, 200 ); myPath->SetMarkers(); myPath->AddLine( Point(100,100), Point(200,100) ); Rectangle rect = Rectangle(200,0,100,200); myPath->AddRectangle( rect ); myPath->SetMarkers(); myPath->AddLine( Point(250,200), Point(250,300) ); myPath->SetMarkers(); // Clear the markers. myPath->ClearMarkers(); // Draw the path to the screen. Pen^ myPen = gcnew Pen( Color::Black,2.0f ); e->Graphics->DrawPath( myPen, myPath ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: