void* __stdcall pdfCreateSoftMask(PPDF IPDF, uint32_t TranspGroup, TSoftMaskType MaskType, uint32_t BackColor);
function pdfCreateSoftMask(const IPDF: PPDF; TranspGroup: Cardinal; MaskType: TSoftMaskType; BackColor: Cardinal): Pointer; stdcall;
Purpose. Build an ExtGState carrying a real /SMask soft mask (luminosity or alpha) derived from an existing transparency-group template (pdfBeginTransparencyGroup above) — the mechanism referenced back in Patterns, Shadings, ExtGState Creation, and Template Placement as the way to attach a genuine soft mask, since pdfCreateExtGState's own GS.SoftMask struct field is dropped.
Description. MaskType is reduced to a binary check — MaskType = smtLuminosity becomes the boolean passed to CreateSoftMaskGS; any other TSoftMaskType value (e.g. an alpha-type mask, if the enum defines one) is treated the same as "not luminosity" rather than being distinctly handled.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
TranspGroup | Handle of an existing transparency-group template. |
MaskType | Only smtLuminosity is distinctly recognized; every other value collapses to the same "non-luminosity" path. |
BackColor | The mask's backdrop color. |
Return value. An opaque ExtGState handle (as a Pointer), consumable via pdfSetExtGState (Extended Graphics State & Color Space Handles); nil if TranspGroup doesn't resolve to an existing template or IPDF is invalid.
See also. pdfBeginTransparencyGroup, pdfSetExtGState.
C# (P/Invoke)
public static extern IntPtr pdfCreateSoftMask(IntPtr IPDF, uint TranspGroup, TSoftMaskType MaskType, uint BackColor);
Object Creation
pdfCreateSoftMask
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.