Help Center

CGpGraphics.FillPolygonmethod

Uses a brush to fill the interior of a polygon.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION FillPolygon (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION FillPolygon (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION FillPolygon (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_, BYVAL nFillMode AS FillMode) AS GpStatus
FUNCTION FillPolygon (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS INT_, BYVAL nFillMode AS FillMode) AS GpStatus

Parameters

NameDescription
pBrushPointer to a brush that is used to paint the interior of the polygon.
ptsPointer to an array of points that make up the vertices of the polygon. The first two points in the array specify the first side of the polygon. Each additional point specifies a new side, the vertices of which include the point and the previous point. If the last point and the first point do not coincide, they specify the last side of the polygon.
nCountInteger that specifies the number of points 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

Uses a brush to fill the interior of a polygon.

Example

' ======================================================================================== ' The following example uses a brush to fill the interior of a polygon. ' ======================================================================================== SUB Example_FillPolygon (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 SolidBrush object DIM blackBrush AS CGpSolidBrush = ARGB_BLACK

' // Create an array of GpPointF objects that define the polygon DIM rgPoints(4) AS GpPointF = {(100, 200), (200, 130), (150, 200), (50, 200), (0, 130)}

' // Fill the polygon graphics.FillPolygon(@blackBrush, @rgPoints(0), 5)

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

Reference

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