CGpGraphicsPath.SetMarkermethod
Designates the last point in this path as a marker point.
Syntax
FUNCTION SetMarker () AS GpStatus
Return value
If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.
If the function fails, it returns one of the other elements of the GpStatus enumeration.
Description
Designates the last point in this path as a marker point.
Remarks
A GraphicsPath object has an array of points and an array of types. Each element in the array of types is a byte that specifies the point type and a set of flags for the corresponding element in the array of points. Possible point types and flags are listed in the PathPointType enumeration.
Each time you add a line, curve, or shape to a path, the point array and the type array are expanded. When you call SetMarker, a marker flag is placed in the last byte of the type array. That flag designates the last point of the point array as a marker point.
Markers divide a path into sections. You can use a GraphicsPathIterator object to draw selected sections of a path.
Example
' ======================================================================================== ' This example sets a marker after adding a rectangle, then adds an ellipse. ' ======================================================================================== SUB Example_SetMarker (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
' // Create path and add overlapping ellipses DIM path AS CGpGraphicsPath path.AddEllipse(100, 80, 150, 100) path.AddEllipse(130, 110, 150, 100)
' // Change fill mode to Winding path.SetFillMode(FillModeWinding)
' // Create brush and fill the path DIM brush AS CGpSolidBrush = ARGB_LIGHTSKYBLUE graphics.FillPath(@brush, @path)
END SUB ' ========================================================================================
Reference
- Include file
CGpPath.inc - Defined in AfxNova/CGpPath.inc:130
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class