ImageGear for C and C++ on Linux v19.10 - Updated
IG_dspl_transparency_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Display Functions > IG_dspl_transparency_get

This function returns the transparency parameters.

Declaration:

 
Copy Code
AT_ERRCOUNT    ACCUAPI  IG_dspl_transparency_get(
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [OUT] LPAT_MODE lpnTranspMode,
        [OUT] LPAT_RGB lpTranspColor,
        [OUT] LPHIGEAR lphIMask,
        [OUT] LPAT_RECTANGLE lpMaskRect,
        [OUT] LPAT_POINT lpMaskLocation
);

Arguments:

Name Type Description
hIGear HIGEAR ImageGear handle of image.
dwGrpID DWORD Identifier of group to use.
lpnTranspMode LPAT_MODE Pointer where TranspMode options are returned. If NULL, then this parameter is ignored.
lpTranspColor LPAT_RGB Pointer where TranspColor option is returned. If NULL, then this parameter is ignored.
hphIMask LPHIGEAR Pointer where TranspMask option is returned. If NULL, then this parameter is ignored. Please note that this function does not change or delete the value of TranspMask, but only makes its copy.
lpMaskRect LPAT_RECTANGLE Pointer to where to return the value of the MaskRect option. If NULL, then this parameter is ignored. If an empty rectangle is returned then it is initialized with a rectangle equal to the entire mask image.
lpMaskLocation LPAT_POINT Pointer to where to return the value of MaskLocation option. 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++.

Example:

 
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    */
AT_RECTANGLE            MaskRect;       /* mask rectangle      */
AT_POINT                MaskLocation;    /* mask location   */
 ...
IG_dspl_transparency_get( hIGear, nGrpID, &nTranspMode, &TranspColor, &hIMask, &MaskRect,
&MaskLocation );
if( IG_image_is_valid( hIMask ) )
        IG_image_delete( hIMask );
 ...