ImageGear for C and C++ on Windows v19.1 - Updated
IG_PDE_image_set_color_mask
API Reference Guide > PDF Component API Reference > PDF Component Objects Reference > Page Editing Objects and Elements > HIG_PDE_IMAGE > IG_PDE_image_set_color_mask

Use this function to set the Mask entry from the image dictionary.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_PDE_image_set_color_mask(
        HIG_PDE_IMAGE hImage,
        LPLONG lpMask,
        UINT nLen
);

Arguments:

Name Type Description
hImage HIG_PDE_IMAGE The image object whose color mask is set.
lpMask LPLONG A pointer to the array of LONG values containing the color mask values.
nLen UINT The number of color mask elements in lpMask - size of lpMask array.

Return Value:

Error count.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

 
Copy Code
//24-bit rgb color mask with 1 mask entry 
LONG lpMask[] = {250, 255, 250, 255, 250, 255}; 
int iMaskLen=6; 
IG_PDE_image_set_color_mask(hElement,lpMask,iMaskLen); 

Remarks:

The mask entry is an array specifying a range of colors to be masked out. Samples in the image that fall within this range are not painted, allowing the existing background to show through. The effect is similar to that of the video technique known as chroma-key.

The value of each Mask entry is an array of 2n integers, [min1 max1 ... minn maxn], where n is the number of color components in the image's color space. Each integer must be in the range 0 to (2^BitsPerComponent - 1), representing color values before decoding with the Decode array. An image sample is masked (not painted) if all of its color components before decoding, c1...cn, fall within the specified ranges.