Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Creates an axial sharing.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 10.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
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 |
Returns number or error.
See also CreateAxialShading function in DynaPDF manual.
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) ]
This function checks for a license.
Created 20th April 2020, last changed 28th December 2020