ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Display Functions > IG_dspl_transparency_set

This function sets the transparency options.


Copy Code
AT_ERRCOUNT  ACCUAPI  IG_dspl_transparency_set(
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [IN] AT_MODE nTranspMode,
        [IN] const LPAT_RGB lpTranspColor,
        [IN] HIGEAR hIMask,
        [IN] const LPAT_RECTANGLE lpMaskRect,
        [IN] const LPAT_POINT lpMaskLocation


Name Type Description
hIGear HIGEAR ImageGear handle of image.
dwGrpID DWORD Identifier of the group in which to set transparency options.
nTranspMode AT_MODE New value of TranspMode to set. Possible value may be:
or a combination of one of the following flags:
and one of these flags:
lpTranspColor const LPAT_RGB New value of TranspColor to set. If NULL, then this parameter is ignored.
hIMask HIGEAR New value of TranspMask option to set. Please note that the image is not deleted and the application code is responsible for removing the old value of this option.
lpMaskRect const LPAT_RECTANGLE New value of MaskRect option to set. If NULL, then this parameter is ignored. An empty rectangle is possible.
lpMaskLocation const LPAT_POINT New value of MaskLocation option to set. If NULL, then this parameter is ignored.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.


Copy Code
HIGEAR           hIGear;        /* HIGEAR handle of image  */
DWORD           nGrpID;        /* display group identifier  */
AT_MODE          nTranspMode;    /* transparency mode  */
AT_RGB          TranspColor;    /* transparency color */
HIGEAR          hIMask;         /* transparent mask   */
/* enable transparent color and mask with default mask rectangle and location oriented and
scaled with main image */ 
nTranspMode =
/* set transparent color to white */
TranspColor.r = TranspColor.g = TranspColor.b = 255;
IG_dspl_transparency_set( hIGear, nGrpID, nTranspMode, &TranspColor, hIMask, NULL, NULL );


This function sets the transparency only for image displaying. For saving image with transparency mask use function IG_display_transparent_set().
Is this page helpful?
Yes No
Thanks for your feedback.