Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.DrawNGon

Draws a n-gon.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 10.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.DrawNGon"; PDF; PosX; PosY; Radius; Alpha; NumSides; FillMode )   More

Parameters

Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
PosX X-Coordinate of the midpoint of the ngon.
PosY Y-Coordinate of the midpoint of the ngon.
Radius The radius.
Alpha Rotation angle in degrees.
NumSides Number of sides. Must be greater 2. 7
FillMode Fill mode. Can be FillNoClose, StrokeNoClose, FillStrokeNoClose, Fill, Stroke, FillStroke, FillEvOdd, FillStrokeEvOdd, FillEvOddNoClose, FillStrokeEvOddNoClose, NoFill or Close. "fill"

Result

Returns OK or error.

Description

Draws a n-gon.
A n-gon is a polygon with "n" number of sides. The minimum number of sides is three.
A n-gon is a closed path that can be filled, stroked or both. It is also possible to draw a n-gon invisible to apply the filling rules nonzero winding number or even-odd. The filling rules are described at DynaPDF.ClipPath. The parameter FillMode is ignored if the circle is drawn inside a clipping path. The fill modes are described at DynaPDF.ClosePath.

If the function succeeds the return value is OK, otherwise an error.

See also DrawNGon function in DynaPDF manual.

Examples

Draw various n-edge objects on top of each other in various shades of gray:

Set Variable [ $r ; Value: MBS("DynaPDF.SetStrokeColor"; $pdf; 0; 0; 0) ]
Set Variable [ $r ; Value: MBS("DynaPDF.DrawNGon"; $pdf; 200; 600; 100; 1; 9; "Stroke") ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetStrokeColor"; $pdf; ,1; ,1; ,1) ]
Set Variable [ $r ; Value: MBS("DynaPDF.DrawNGon"; $pdf; 200; 600; 100; 1; 8; "Stroke") ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetStrokeColor"; $pdf; ,2; ,2; ,2) ]
Set Variable [ $r ; Value: MBS("DynaPDF.DrawNGon"; $pdf; 200; 600; 100; 1; 7; "Stroke") ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetStrokeColor"; $pdf; ,3; ,3; ,3) ]
Set Variable [ $r ; Value: MBS("DynaPDF.DrawNGon"; $pdf; 200; 600; 100; 1; 6; "Stroke") ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetStrokeColor"; $pdf; ,4; ,4; ,4) ]
Set Variable [ $r ; Value: MBS("DynaPDF.DrawNGon"; $pdf; 200; 600; 100; 1; 5; "Stroke") ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetStrokeColor"; $pdf; ,5; ,5; ,5) ]
Set Variable [ $r ; Value: MBS("DynaPDF.DrawNGon"; $pdf; 200; 600; 100; 1; 4; "Stroke") ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 18th September 2020, last changed 23th November 2020


DynaPDF.DrawCircle - DynaPDF.DrawPie