GdipAddPathLine2Ifunction
Adds a line to the current figure of this path.
Syntax
FUNCTION GdipAddPathLine2I (BYVAL path AS GpPath PTR, BYVAL points AS GpPoint PTR, BYVAL count AS INT_) AS GpStatus
GdipAddPathLine2 — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
path | [in] Pointer to the GraphicsPath object. | |
points | [in] Pointer to an array of points that specify the starting and ending points of the lines. The first point in the array is the starting point of the first line, and the last point in the array is the ending point of the last line. Each of the other points serves as ending point for one line and starting point for the next line. | |
count | [in] Long integer value that specifies the number of elements in the points array. |
Description
Adds a cardinal spline to the current figure of this path.
Example
' ======================================================================================== ' This example draws a polyline using GdipAddPathLine2. ' ======================================================================================== SUB Example_DrawLine2 (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 GraphicsPath object and initializes the fill mode. DIM path AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @path)
' // Define points for the polyline
DIM pts(0 TO 4) AS GpPointF pts(0).x = 60 : pts(0).y = 100 pts(1).x = 120 : pts(1).y = 40 pts(2).x = 180 : pts(2).y = 100 pts(3).x = 150 : pts(3).y = 180 pts(4).x = 90 : pts(4).y = 180
' // Add connected lines to path hStatus = GdipAddPathLine2(path, @pts(0), 5)
' // Create pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_DARKGRAY, 2, UnitWorld, @pen)
' // Draw 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:2031
- Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
- Topic: GraphicsPath Functions