SetImageAsMask

Image handling, Page layout

Description

This function must be called to prepare the image before it is used as a mask for another image. The mask image must be a grayscale image, and be either 1-bit or 8-bit. Depending on your needs you may want to call ReverseImage which will reverse the effects of the mask. A soft-mask is just a normal image, so if you have an image setup as a stencil mask and no longer want it to be a mask just change it to a soft mask image (MaskType = 2).

Syntax

Delphi

Function TPDFlib.SetImageAsMask(MaskType: Integer): Integer;

ActiveX

Function PDFlib::SetImageAsMask(MaskType As Long) As Long

DLL

int DLSetImageAsMask(int InstanceID, int MaskType);

Parameters

MaskTypeThe type of mask to set this image as: 1 = Stencil mask (only 1-bit images) 2 = Soft mask (1-bit and 8-bit images)

Return values

1The selected image was flagged as a stencil mask (MaskType 1) or soft mask (MaskType 2); stencil masks require a 1-bit DeviceGray image, soft masks require a DeviceGray image and RGB images are converted first
0No image is selected, MaskType is neither 1 nor 2, or the image does not meet the colour space or bit depth requirements of the requested mask type