DynaPDF.CreateRadialShading
---------------------------

Creates radial sharing.

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

MBS( "DynaPDF.CreateRadialShading"; PDF; sX; sY; R1; eX; eY; R2; SCenter; SColor; EColor { ; Extend1; Extend2 } ) 

**MBS**( **"DynaPDF.CreateRadialShading";** /\* Creates radial sharing. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$sX**; /\* X-Coordinate of the inner circle \*/   
**$sY**; /\* Y-Coordinate of the inner circle \*/   
**$R1**; /\* Radius of the inner circle \*/   
**$eX**; /\* X-Coordinate of the outer circle \*/   
**$eY**; /\* Y-Coordinate of the outer circle \*/   
**$R2**; /\* Radius of the outer circle \*/   
**$SCenter**; /\* Shading center \*/   
**$SColor**; /\* Start colore.g. MBS("DynaPDF.RGB"; 120; 120; 220) \*/   
**$EColor**; /\* End colore.g. MBS("DynaPDF.RGB"; 255; 255; 255) /\* white \*/ \*/   
**$Extend1**; /\* Optional; Extend the shading beyond the start point.   
Pass 1 to extend or 0 if not. Default is 0.e.g. 0 \*/   
**$Extend2**) /\* Optional; Extend the shading beyond the end point.   
Pass 1 to extend or 0 if not. Default is 0.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |  |
| sX | X-Coordinate of the inner circle |  |  |
| sY | Y-Coordinate of the inner circle |  |  |
| R1 | Radius of the inner circle |  |  |
| eX | X-Coordinate of the outer circle |  |  |
| eY | Y-Coordinate of the outer circle |  |  |
| R2 | Radius of the outer circle |  |  |
| SCenter | Shading center |  |  |
| SColor | Start color | MBS("DynaPDF.RGB"; 120; 120; 220) |  |
| EColor | End color | MBS("DynaPDF.RGB"; 255; 255; 255) /\* white \*/ |  |
| Extend1 | Extend the shading beyond the start point.    Pass 1 to extend or 0 if not. Default is 0. | 0 | Optional |
| Extend2 | Extend the shading beyond the end point.    Pass 1 to extend or 0 if not. Default is 0. | 0 | Optional |

### Result

Returns number or error.

### Description

Creates radial sharing.  
Radial shadings define a color blend or gradient that varies between two circles. The shading may optionally be extended beyond the starting or ending circles by continuing the boundary colors indefinitely. Shadings of this type are commonly used to depict three-dimensional spheres and cones.   
The shading center defines the point from where the first color will blend into the other. A value of 1 determines the exact center between the start and end point of the shading. Smaller values shift the shading center in direction to the start circle, greater values to the end circle.   
Radial shadings can be drawn into a clipping path to restrict painting into this path. If the shading is drawn outside of a clipping path it is applied to the entire page. Not that extended shadings are opaque, objects behind the shading become invisible if they are overprinted by the shading.   
Shadings are drawn by using the current coordinate system. It is recommended to understand that shadings have its own dimension like a normal shape. The parameters Extend1 and Extend2 extend the shading beyond its dimension. If the shading is extended it must normally be drawn into a clipping path to avoid overprinting of other objects.   
Shadings support any device, ICCBased, and special color spaces like DeviceN or Separation. The color values of the start and end color must be defined in the current color space. See also [DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md), [DynaPDF.SetExtColorSpace](DynaPDFSetExtColorSpace.md).   
This function creates a shading object but it doesn't draw it on the page. The shading can be drawn with [DynaPDF.ApplyShading](DynaPDFApplyShading.md).   
If the function succeeds the return value is the shading handle, a value greater or equal zero. If the function fails, it returns an error.  
See also [CreateRadialShading](https://www.monkeybreadsoftware.com/DynaPDF-Manual/CreateRadialShading.shtml) function in DynaPDF manual.

### Examples

Create a radial shading:

 Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SaveGraphicState](DynaPDFSaveGraphicState.md)"; $PDF ) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.Rectangle](DynaPDFRectangle.md)"; $PDF ; 100; 100; 200; 100; "NoFill") \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.ClipPath](DynaPDFClipPath.md)"; $PDF ; "Winding"; "NoFill") \]   
Set Variable \[ $sh ; Value: MBS ( "DynaPDF.CreateRadialShading"; /\* Creates radial sharing. \*/  
$PDF ; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
165; /\* X-Coordinate of the inner circle \*/   
170; /\* Y-Coordinate of the inner circle \*/   
5; /\* Radius of the inner circle \*/   
150; /\* X-Coordinate of the outer circle \*/   
185; /\* Y-Coordinate of the outer circle \*/   
100; /\* Radius of the outer circle \*/   
,7; /\* Shading center \*/   
MBS ("[DynaPDF.RGB](DynaPDFRGB.md)"; 255; 255; 255) /\* white \*/; /\* Start colore.g. MBS ("[DynaPDF.RGB](DynaPDFRGB.md)"; 120; 120; 220) \*/   
MBS ("[DynaPDF.RGB](DynaPDFRGB.md)"; 120; 120; 220); /\* End colore.g. MBS ("[DynaPDF.RGB](DynaPDFRGB.md)"; 255; 255; 255) /\* white \*/ \*/   
1; /\* Optional; Extend the shading beyond the start point.   
Pass 1 to extend or 0 if not. Default is 0.e.g. 0 \*/   
1) /\* Optional; Extend the shading beyond the end point.   
Pass 1 to extend or 0 if not. Default is 0.e.g. 0 \*/ \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.ApplyShading](DynaPDFApplyShading.md)"; $PDF ; $sh ) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.RestoreGraphicState](DynaPDFRestoreGraphicState.md)"; $PDF ) \]  
### See also

- [DynaPDF.ApplyShading](DynaPDFApplyShading.md)
- [DynaPDF.ClipPath](DynaPDFClipPath.md)
- [DynaPDF.CreateAxialShading](DynaPDFCreateAxialShading.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.Rectangle](DynaPDFRectangle.md)
- [DynaPDF.RestoreGraphicState](DynaPDFRestoreGraphicState.md)
- [DynaPDF.RGB](DynaPDFRGB.md)
- [DynaPDF.Save](DynaPDFSave.md)
- [DynaPDF.SaveGraphicState](DynaPDFSaveGraphicState.md)
- [DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md)

### Release notes

- **Version 11.0**
    - Fixed [DynaPDF.CreateAxialShading](https://www.mbsplugins.eu/DynaPDFCreateAxialShading.shtml) and [DynaPDF.CreateRadialShading](https://www.mbsplugins.eu/DynaPDFCreateRadialShading.shtml) to return handle for new shading.
- **Version 10.2**
    - Added [DynaPDF.ApplyShading](https://www.mbsplugins.eu/DynaPDFApplyShading.shtml), [DynaPDF.CreateAxialShading](https://www.mbsplugins.eu/DynaPDFCreateAxialShading.shtml), [DynaPDF.CreateRadialShading](https://www.mbsplugins.eu/DynaPDFCreateRadialShading.shtml) and [DynaPDF.PlaceSigFieldValidateIcon](https://www.mbsplugins.eu/DynaPDFPlaceSigFieldValidateIcon.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 11.0pr8](https://www.mbsplugins.de/archive/2021-01-16/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [News about the MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-19/News_about_the_MBS_FileMaker_P/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.2pr5](https://www.mbsplugins.de/archive/2020-04-27/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 20th April 2020 , last changed 15th January 2021

  
[DynaPDF.CreateOCG](DynaPDFCreateOCG.md) - [DynaPDF.CreateRadioButton](DynaPDFCreateRadioButton.md)

[HTML Version](DynaPDFCreateRadialShading.shtml)