Blog: Tech Talk

agsdix-fas fa-home

Blog: Home

agsdix-fas fa-pen-fancy

Blog: CEO's Corner

agsdix-fas fa-code

Blog: Tech Talk

Blog: Product Releases

agsdix-fas fa-chalkboard-teacher

Blog: Viewing

Blog: Conversion

arrow left circle icon Blog: Tech Talk

Displaying Transparent Images

by | Apr 24, 2012

Snowbound Software’s RasterMasterTM for Windows includes the ability to display transparent GIF images. To display a transparent GIF image, you can use the IMG_display_bitmap_transp() and the IMGLOW_get_transp_color() functions. The IMG_display_bitmap_transp() function displays the foreground color for a GIF image. The IMGLOW_get_transp_color() returns the background color for GIF images if this information is available in the header.

IMG_display_bitmap_transp()

This function displays transparent GIF images. It only draws the foreground color when displaying. It does not draw the background color. To get the background color from an image, use the IMGLOW_get_transp_color() function. See the IMGLOW_get_transp_color() function below for more information.

The IMG_display_bitmap_transp() function compares each pixel to the background color passed in and does not draw foreground pixels that are identical.

Note: A negative value indicates an error. See the imgerr.h file.

Syntax

int IMG_display_bitmap_transp (int imghandle, IMGPORT hdc, int xpos, int ypos, int width, int height, int tcolor);

Remark

The table below lists the IMG_display_bitmap_transp function variable descriptions.

VariableDescription
imghandleStandard image handle obtained from a decompress function such asIMG_decompress_bitmap()
hdcWindows device context to display
hwndHandle of window within which to enable scroll bars
xposStarting X coordinate for display of image
yposStarting Y coordinate for display of image
widthHorizontal width to display image
heightVertical height to display image
tcolorBackground color of image to ignore

Returns

Integer

IMGLOW_get_transp_color ()

This function returns the background color for GIF images if this information is available in the header. It returns 1 byte or a NO_TCOLOR_FOUND error message if not available.

Note: A negative value indicates an error. See the imgerr.h file.

Syntax

int IMGLOW_get_transp_color (int imghandle);

Remark

The table below lists the IMGLOW_get_transp_color function variable description.

VariableDescription
imghandleStandard image handle obtained from a decompress function such asIMG_decompress_bitmap()

Returns

Integer