Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
DynaPDF.DrawCircle
This function draws a circle.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| DynaPDF | 3.1 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| The PDF reference returned from DynaPDF.New. | ||
| PosX | X-Coordinate of the midpoint of the pie. | $x |
| PosY | Y-Coordinate of the midpoint of the pie. | $y |
| Radius | The radius to use. | $radius |
| 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
This function draws a circle.The draw direction can be changed with the function DynaPDF.SetDrawDirection.
A circle is a closed path that can be filled, stroked or both. It is also possible to draw a circle invisible to apply the filling rules nonzero winding number or even-odd. The filling rules are described under DynaPDF.ClipPath. The parameter FillMode is ignored if the circle is drawn inside a clipping path. The fill modes are described under DynaPDF.ClosePath.
See also DrawCircle function in DynaPDF manual.
Examples
Clip image to circle:
# Initialize DynaPDF if needed
If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
Perform Script [ “InitDynaPDF” ]
End If
# Clear current PDF document
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
# Add image on page
Set Variable [ $destPage ; Value: 1 ]
Set Variable [ $r ; Value: MBS("DynaPDF.AppendPage"; $pdf) ]
# no recompression if possible! But if needed, we use JPEG 90%
Set Variable [ $r ; Value: MBS("DynaPDF.SetSaveNewImageFormat"; $pdf; 0) ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetJPEGQuality"; $pdf; 90) ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetCompressionFilter"; $pdf; "jpeg") ]
# Save old state to restore later
Set Variable [ $r ; Value: MBS( "DynaPDF.SaveGraphicState"; $pdf ) ]
# Draw circle for clipping
Set Variable [ $r ; Value: MBS( "DynaPDF.DrawCircle"; $pdf; 260; 220; 100; "nofill" ) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.ClipPath"; $pdf; "Winding"; "fill" ) ]
# Draw clipped image
Set Variable [ $r ; Value: MBS("DynaPDF.InsertImage"; $pdf; Merge PDFs::InputImage; 100; 100; 320; 200) ]
# restore graphics static to get unclipped drawing
Set Variable [ $r ; Value: MBS( "DynaPDF.RestoreGraphicState"; $pdf ) ]
# Close page and store PDF in container
Set Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ]
Set Field [ Merge PDFs::FinalPDF ; MBS("DynaPDF.Save"; $pdf; "Merged.pdf") ]
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]
See also
- DynaPDF.DrawArc
- DynaPDF.DrawChord
- DynaPDF.IsInitialized
- DynaPDF.New
- DynaPDF.Release
- DynaPDF.RestoreGraphicState
- DynaPDF.Save
- DynaPDF.SaveGraphicState
- DynaPDF.SetJPEGQuality
- DynaPDF.SetSaveNewImageFormat
Example Databases
Blog Entries
Created 18th August 2014, last changed 17th January 2019
DynaPDF.DrawChord - DynaPDF.DrawNGon
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins