Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.CreateAxialShading
Creates an axial sharing.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 10.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
sX | X-Coordinate of the start point | 0 | |
sY | Y-Coordinate of the start point | 0 | |
eX | X-Coordinate of the end point | 0 | |
eY | Y-Coordinate of the end point | 78 | |
SCenter | Shading center | 2 | |
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 an axial sharing.Axial shadings define a color blend or gradient that varies along a linear axis between two endpoints and extends indefinitely perpendicular to that axis. The shading may optionally be extended beyond either or both endpoints by continuing the boundary colors indefinitely.
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 starting and ending point of the shading. Smaller values shift the shading center in direction to the start point, greater values in the direction to the end point.
Axial 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 becomes 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 the color spaces DeviceGray, DeviceRGB, and DeviceCMYK. The color values of the start and end color must be defined in the current color space. See also DynaPDF.SetColorSpace.
Shadings are invisible as long they are not drawn by using the function DynaPDF.ApplyShading. DynaPDF.ApplyShading requires a shading handle that was returned by this function.
If the function succeeds the return value is the handle of the shading, a value greater or equal zero. If the function fails it returns an error.
See also CreateAxialShading function in DynaPDF manual.
Examples
Draw rectangle with shading:
# save state before, so you can restore
Set Variable [ $r; Value:MBS( "DynaPDF.SaveGraphicState"; $PDF) ]
# draw something for a path
Set Variable [ $r; Value:MBS( "DynaPDF.Rectangle"; $PDF; 0; 0; 200; 80; "NoFill") ]
# to clip here by this path
Set Variable [ $r; Value:MBS( "DynaPDF.ClipPath"; $PDF; "Winding"; "NoFill") ]
# and now create a shading and apply it
Set Variable [ $sh; Value:MBS( "DynaPDF.CreateAxialShading"; $PDF; 0; 0; 200; 0; ,5; MBS("DynaPDF.RGB"; 255; 255; 255) /* white */; MBS("DynaPDF.RGB"; 120; 120; 220); 1; 1) ]
Set Variable [ $r; Value:MBS( "DynaPDF.ApplyShading"; $PDF; $sh) ]
# restore
Set Variable [ $r; Value:MBS( "DynaPDF.RestoreGraphicState"; $PDF) ]
See also
- DynaPDF.ApplyShading
- DynaPDF.ClipPath
- DynaPDF.CreateRadialShading
- DynaPDF.New
- DynaPDF.Rectangle
- DynaPDF.RestoreGraphicState
- DynaPDF.RGB
- DynaPDF.Save
- DynaPDF.SaveGraphicState
- DynaPDF.SetColorSpace
Release notes
- Version 11.0
- Fixed DynaPDF.CreateAxialShading and DynaPDF.CreateRadialShading to return handle for new shading.
- Version 10.2
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 11.0pr8
- News about the MBS FileMaker Plugin 10.2
- MBS FileMaker Plugin, version 10.2pr5
This function checks for a license.
Created 20th April 2020, last changed 28th December 2020
