API referenceGraphics

gpcAddVertex

Append one contour (a closed vertex loop) to a caller-owned

C
int32_t __stdcall gpcAddVertex(IGPC IGPC_, PGPCPolygon Poly, PGPCVertexList VertexList);
Delphi
function gpcAddVertex(const IGPC_: IGPC; Poly: PGPCPolygon; VertexList: PGPCVertexList): Integer; stdcall;

Purpose. Append one contour (a closed vertex loop) to a caller-owned gpc_polygon structure.

Description. Requires both Poly and VertexList to be non-null and VertexList^.num_vertices > 0 with a non-null vertex array; grows Poly^.contour by one entry via AllocMem and copies the vertex data in verbatim. Memory ownership is explicit and manual: the grown contour array (and each contour's vertex array) is allocated with AllocMem and must be freed by the caller via FreeMem — there is no matching "free one contour" helper in the ABI; freeing happens either contour-by-contour by the caller or, for a gpcClipPoly result polygon, by freeing every Res.contour[i].vertex array and then Res.contour itself.

Parameters.

ParameterDescription
IGPC_Context handle (unused for any per-call state — see gpcNewGPC).
PolyThe polygon to grow; caller-owned, must eventually be freed by the caller.
VertexListThe contour to append (num_vertices + vertex array).

Return value. 0 on success; -1 if Poly/VertexList is null or VertexList describes zero/no vertices.

See also. gpcClipPoly.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int gpcAddVertex(IntPtr IGPC_, IntPtr Poly, IntPtr VertexList);
Area
Graphics
Category

Polygon Clipper

Exported names

gpcAddVertex

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.