WinDrawBitmap

WinDrawBitmap draws a bit-map image by copying it into a window linked to a target presentation space. A call to this function is valid only in draw mode (DM_DRAW), and only for a screen device context. This function does not require an application to select a bit map into a presentation space before the application draws the corresponding image. An application can use WinDrawBitmap to scale bit maps by specifying DBM_STRETCH as the last argument, and the address of a RECTL structure as the fourth argument. The coordinates in this structure are always device coordinates.

WinDrawBitmap draws both color and monochrome bit maps. Color bit maps require no color conversion. Monochrome bit maps can be drawn in any two colors which can be explicitly specified as parameters to the call or taken from the image bundle. These parameters will be color table indexes or RGB values, depending on the color table mode of the target presentation space. The current image bundle mix modes are used and, for certain mix values, will affect color.

You can call WinDrawBitmap in retain mode, but the bit-map image will only be drawn and not recorded in the segments.

Note: An application can determine the current colors and their corresponding mix modes by calling GpiQueryAttrs. The application can set them by calling GpiSetAttrs.

An inverted bit map is a bit map in which the colors have been inverted; white becomes black and black becomes white. An application can draw inverted bit maps by calling WinDrawBitmap and passing it DBM_INVERT as the last argument. An application can draw halftone bit maps by calling WinDrawBitmap and passing it DBM_HALFTONE as the last argument. Before drawing the bit map, clear the presentation space to CLR_BACKGROUND using GpiErase.


[Back: Drawing Bit Maps]
[Next: GpiImage]