Help Center

CGpGraphicsPath.AddLinesmethod

Adds a sequence of connected lines to the current figure of this path.

GraphicsmethodCGpPath.incdocumented

Syntax

FUNCTION AddLines (BYVAL pts AS GpPointF PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION AddLines (BYVAL pts AS GpPoint PTR, BYVAL count AS INT_) AS GpStatus

Parameters

NameDescription
ptsPointer 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.
countInteger that specifies the number of elements in the pts array.

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

Adds a sequence of connected lines to the current figure of this path.

Example

' ======================================================================================== ' The following example creates a GraphicsPath object path, adds a sequence of four ' connected lines to path, and then draws path. ' ======================================================================================== SUB Example_AddLines (BYVAL hdc AS HDC)

' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi

DIM pts(0 TO 4) AS GpPoint = {(20, 20), (30, 30), (40, 24), (50, 30), (60, 20)} DIM path AS CGpGraphicsPath path.AddLines(@pts(0), 5)

' // Draw the path DIM pen AS CGpPen = ARGB_RED graphics.DrawPath(@pen, @path)

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

Reference

  • Include file CGpPath.inc
  • Defined in AfxNova/CGpPath.inc:194
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class