Help Center

CGpGraphicsPath.AddPolygonmethod

Adds a polygon to this path.

GraphicsmethodCGpPath.incdocumented

Syntax

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

Parameters

NameDescription
ptsPointer to an array of points that specifies the vertices of the polygon.
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 polygon to this path.

Example

' ======================================================================================== ' The following example creates a GraphicsPath object path, adds a polygon to path, and then draws path. ' ======================================================================================== SUB Example_AddPolygon (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 2) AS GpPoint = {(20, 20), (120, 20), (120, 70)} DIM path AS CGpGraphicsPath path.AddPolygon(@pts(0), 3)

' // 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:430
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class