Help Center

GdipGetPathLastPointfunction

Gets the ending point of the last figure in this path.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipGetPathLastPoint (BYVAL path AS GpPath PTR, BYVAL lastPoint AS GpPointF PTR) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.
lastPoint[out] Pointer to a GpPointF structure that receives the last point.

Description

Gets the ending point of the last figure in this path.

Example

' ======================================================================================== ' This example retrieves the last point from a GraphicsPath using GdipGetPathLastPoint. ' ======================================================================================== SUB Example_GetLastPoint (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 shape hStatus = GdipAddPathRectangle(path, 100, 80, 150, 100)

' // Retrieve last point DIM lastPoint AS GpPointF hStatus = GdipGetPathLastPoint(path, @lastPoint)

' // Display result AfxMsg "Last point: ("& WSTR(lastPoint.x) & ", " & WSTR(lastPoint.y) & ")"

' // Create pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_ORANGE, 2, UnitWorld, @pen)

' // Draw the path hStatus = GdipDrawPath(graphics, pen, path)

' // Cleanup IF pen THEN GdipDeleteBrush(pen) IF path THEN GdipDeletePath(path) IF graphics THEN GdipDeleteGraphics(graphics)

END SUB ' ========================================================================================

Reference

  • Defined in AfxNova/AfxGdiPlus.bi:2003
  • Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
  • Topic: GraphicsPath Functions