DynaPDF.DrawCircle
------------------

This function draws a circle.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.DrawCircle"; PDF; PosX; PosY; Radius; FillMode ) 

**MBS**( **"DynaPDF.DrawCircle";** /\* This function draws a circle. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PosX**; /\* X-Coordinate of the midpoint of the pie.e.g. $x \*/   
**$PosY**; /\* Y-Coordinate of the midpoint of the pie.e.g. $y \*/   
**$Radius**; /\* The radius to use. \*/   
**$FillMode**) /\* Fill mode. Can be FillNoClose, StrokeNoClose, FillStrokeNoClose, Fill, Stroke, FillStroke, FillEvOdd, FillStrokeEvOdd, FillEvOddNoClose, FillStrokeEvOddNoClose, NoFill or Close.e.g. "fill" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| 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](DynaPDFSetDrawDirection.md).  
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](DynaPDFClipPath.md). The parameter FillMode is ignored if the circle is drawn inside a clipping path. The fill modes are described under [DynaPDF.ClosePath](DynaPDFClosePath.md).  
See also [DrawCircle](https://www.monkeybreadsoftware.com/DynaPDF-Manual/DrawCircle.shtml) function in DynaPDF manual.

### Examples

Clip image to circle:

 # Initialize DynaPDF if needed   
If \[ MBS ("[DynaPDF.IsInitialized](DynaPDFIsInitialized.md)") ≠ 1 \]   
 Perform Script \[ “InitDynaPDF” \]  
End If  
\# Clear current PDF document   
Set Variable \[ $pdf ; Value: MBS ("[DynaPDF.New](DynaPDFNew.md)") \]   
\# Add image on page   
Set Variable \[ $destPage ; Value: 1 \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.AppendPage](DynaPDFAppendPage.md)"; $pdf ) \]   
\# no recompression if possible! But if needed, we use JPEG 90%   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetSaveNewImageFormat](DynaPDFSetSaveNewImageFormat.md)"; $pdf ; 0) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetJPEGQuality](DynaPDFSetJPEGQuality.md)"; $pdf ; 90) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetCompressionFilter](DynaPDFSetCompressionFilter.md)"; $pdf ; "jpeg") \]   
\# Save old state to restore later   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SaveGraphicState](DynaPDFSaveGraphicState.md)"; $pdf ) \]   
\# Draw circle for clipping   
Set Variable \[ $r ; Value: MBS ( "DynaPDF.DrawCircle"; $pdf ; 260; 220; 100; "nofill" ) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.ClipPath](DynaPDFClipPath.md)"; $pdf ; "Winding"; "fill" ) \]   
\# Draw clipped image   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.InsertImage](DynaPDFInsertImage.md)"; $pdf ; Merge PDFs::InputImage ; 100; 100; 320; 200) \]   
\# restore graphics static to get unclipped drawing   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.RestoreGraphicState](DynaPDFRestoreGraphicState.md)"; $pdf ) \]   
\# Close page and store PDF in container   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.EndPage](DynaPDFEndPage.md)"; $pdf ) \]   
Set Field \[ Merge PDFs::FinalPDF ; MBS ("[DynaPDF.Save](DynaPDFSave.md)"; $pdf ; "Merged.pdf") \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.Release](DynaPDFRelease.md)"; $pdf ) \]  
### See also

- [DynaPDF.DrawArc](DynaPDFDrawArc.md)
- [DynaPDF.DrawChord](DynaPDFDrawChord.md)
- [DynaPDF.IsInitialized](DynaPDFIsInitialized.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.Release](DynaPDFRelease.md)
- [DynaPDF.RestoreGraphicState](DynaPDFRestoreGraphicState.md)
- [DynaPDF.Save](DynaPDFSave.md)
- [DynaPDF.SaveGraphicState](DynaPDFSaveGraphicState.md)
- [DynaPDF.SetJPEGQuality](DynaPDFSetJPEGQuality.md)
- [DynaPDF.SetSaveNewImageFormat](DynaPDFSetSaveNewImageFormat.md)

### Example Databases

- [DynaPDF/Picture to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Picture%20to%20PDF.shtml#7ScriptAnchor_)

### Blog Entries

- [MBS Filemaker Plugin, version 3.2pr4](https://www.mbsplugins.de/archive/2013-03-18/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 17th January 2019

  
[DynaPDF.DrawChord](DynaPDFDrawChord.md) - [DynaPDF.DrawNGon](DynaPDFDrawNGon.md)

[HTML Version](DynaPDFDrawCircle.shtml)