GdipReversePathfunction
Reverses the order of the points that define this path's lines and curves.
Syntax
FUNCTION GdipReversePath (BYVAL path AS GpPath PTR) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
path | [in] Pointer to the GraphicsPath object. |
Description
Reverses the order of the points that define this path's lines and curves.
Example
' ======================================================================================== ' This example draws a path before and after reversing it using GdipReversePath. ' ======================================================================================== SUB Example_ReversePath (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 GraphicsPath DIM path AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @path)
' // Add a triangle hStatus = GdipAddPathLine(path, 100, 100, 200, 100) hStatus = GdipAddPathLine(path, 200, 100, 150, 200) hStatus = GdipClosePathFigure(path)
' // Draw original path in blue DIM penBlue AS GpPen PTR hStatus = GdipCreatePen1(ARGB_BLUE, 2, UnitWorld, @penBlue) hStatus = GdipDrawPath(graphics, penBlue, path)
' // Reverse the path hStatus = GdipReversePath(path)
' // Offset the path for visibility DIM matrix AS GpMatrix PTR hStatus = GdipCreateMatrix(@matrix) hStatus = GdipTranslateMatrix(matrix, 120, 0, MatrixOrderAppend) hStatus = GdipTransformPath(path, matrix) GdipDeleteMatrix(matrix)
' // Draw reversed path in red DIM penRed AS GpPen PTR hStatus = GdipCreatePen1(ARGB_RED, 2, UnitWorld, @penRed) hStatus = GdipDrawPath(graphics, penRed, path)
' // Cleanup IF penBlue THEN GdipDeleteBrush(penBlue) IF penRed THEN GdipDeleteBrush(penRed) IF path THEN GdipDeletePath(path) IF graphics THEN GdipDeleteGraphics(graphics)
END SUB ' ========================================================================================
Reference
- Defined in AfxNova/AfxGdiPlus.bi:2002
- Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
- Topic: GraphicsPath Functions