GdipWindingModeOutlinefunction
Transforms and flattens this path, and then converts this path's data points so that they represent only the outline of the path.
Syntax
FUNCTION GdipWindingModeOutline (BYVAL path AS GpPath PTR, BYVAL matrix AS GpMatrix PTR, BYVAL flatness AS REAL) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
path | [in] Pointer to the GraphicsPath object. | |
matrix | [in] Pointer to a Matrix object that specifies the transformation. If this parameter is NULL, no transformation is applied. The default value is NULL. | |
flatness | [in] Simple prevision value that specifies the maximum error between the path and its flattened approximation. Reducing the flatness increases the number of line segments in the approximation. The default value is FlatnessDefault. |
Description
Transforms and flattens this path, and then converts this path's data points so that they represent only the outline of the path.
Example
' ======================================================================================== ' The following example creates a GraphicsPath object and calls the GdiAddPathClosedCurve ' method to add a closed cardinal spline to the path. The code calls the GdipWidenPath function ' to widen the path and then draws the path. Next, the code calls the GdipWindingModeOutline ' function The code calls the GdipTranslateWorldTransform function so that the outlined path ' drawn by the subsequent call to GdipDrawPath sits to the right of the first path. ' ======================================================================================== SUB Example_WindingModeOutline (BYVAL hdc AS HDC)
DIM hStatus AS LONG
' // Create a graphics object from the device context DIM graphics AS GpGraphics PTR hStatus = GdipCreateFromHDC(hdc, @graphics)
' // Get the DPI scaling ratios DIM dpiX AS SINGLE hStatus = GdipGetDpiX(graphics, @dpiX) DIM rxRatio AS SINGLE = dpiX / 96 DIM dpiY AS SINGLE hStatus = GdipGetDpiY(graphics, @dpiY) Dim ryRatio AS SINGLE = dpiY / 96 ' // Set the scale transform hStatus = GdipScaleWorldTransform(graphics, rxRatio, ryRatio, MatrixOrderPrepend)
' // Create a path DIM path AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @path)
' // Create the pens. DIM bluePen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_RED, 1, UnitWorld, @bluePen) DIM greenPen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_LIGHTGREEN, 10, UnitWorld, @greenPen)
' // Add a closed curve DIM pts(3) AS GpPointF pts(0).x = 20 : pts(0).y = 20 pts(1).x = 160 : pts(1).y = 100 pts(2).x = 140 : pts(2).y = 60 pts(3).x = 60 : pts(3).y = 100 hStatus = GdipAddPathClosedCurve(path, @pts(0), 4)
hStatus = GdipWidenPath(path, greenPen, NULL, FlatnessDefault) hStatus = GdipDrawPath(graphics, bluePen, path) hStatus = GdipWindingModeOutline(path, NULL, FlatnessDefault) hStatus = GdipTranslateWorldTransform(graphics, 180, 0, MatrixOrderPrepend) hStatus = GdipDrawPath(graphics, bluePen, path)
' // Cleanup IF bluePen THEN GdipDeletePen(bluePen) IF greenPen THEN GdipDeletePen(greenPen) IF path THEN GdipDeletePath(path) IF graphics THEN GdipDeleteGraphics(graphics)
END SUB ' ========================================================================================
Reference
- Defined in AfxNova/AfxGdiPlus.bi:2050
- Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
- Topic: GraphicsPath Functions