Tips For Success

Having the best tools for document imaging is only half of the equation. Our Tech Tips are designed to provide you with valuable information to help you succeed by achieving faster results with our RasterMaster Imaging and Conversion SDKs or VirtualViewer high-speed document and image viewers. New time-saving tips are added monthly - you can receive them through Imaging News or our Tech Tips RSS feed.

Get Started with VirtualViewer

Tech Tip: Displaying Transparent Images

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.

Variable

Description

imghandle

Standard image handle obtained from a decompress function such as IMG_decompress_bitmap()

hdc

Windows device context to display

hwnd

Handle of window within which to enable scroll bars

xpos

Starting X coordinate for display of image

ypos

Starting Y coordinate for display of image

width

Horizontal width to display image

height

Vertical height to display image

tcolor

Background 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.

Variable

Description

imghandle

Standard image handle obtained from a decompress function such as IMG_decompress_bitmap()


Returns
Integer