CGpGraphics.DrawLinesmethod
Draws a sequence of connected lines.
Syntax
FUNCTION DrawLines (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS LONG) AS GpStatus
FUNCTION DrawLines (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS LONG) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
pPen | Pointer to a pen that is used to draw the lines. | |
pts | Pointer to an array of GpPointF structures that specify the starting and ending points of the lines. | |
nCount | Integer that specifies the number of elements in the points 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
Draws a sequence of connected lines.
Example
' ======================================================================================== ' The following example draws a sequence of connected lines. ' ======================================================================================== SUB Example_DrawLines (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
' // Create a Pen object DIM blackPen AS CGpPen = CGpPen(ARGB_BLACK, 3)
' // Create an array of PointF objects that define the lines to draw DIM point1 AS GpPointF = (10, 10) DIM point2 AS GpPointF = (10, 100) DIM point3 AS GpPointF = (200, 50) DIM point4 AS GpPointF = (250, 300) DIM pts(0 TO 3) AS GpPointF = {point1, point2, point3, point4}
' // Draw the lines graphics.DrawLines(@blackPen, @pts(0), 4)
END SUB
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:459
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class