CombineBMP

#include "BIDIB.H"

 

UINT CALLBACK CombineBMP( Int                X,
Int                Y,
HANDLE*  hDestination,
HANDLE    hSource,
HANDLE    hMask
DWORD      dwMode)

Description

This function will combine two device dependent bitmaps (BMP) with a mask. The mask is also a device independent bitmap. The mask should be used to combine the source bitmap with the destination bitmap.

Parameters

int

X

The destination X coordinate of the source bitmap on the destination bitmap.

int

Y

The destination Y coordinate of the source bitmap on the destination bitmap.

HBITMAP

*hDestination

The destination BMP, if Null handle then create an empty BMP and use it as the destination.

HBITMAP

hSource

The source BMP.

HBITMAP

hMask

The mask BMP.

DWORD

dwMode

The masking mode Opaque or Transparent.

COMB_OPAQU and COMB_TRANSPARENT.

Return values

TRUE on success, FALSE if failed.

Requirements

Header :     Declared in BiDIB.h; include BiDIB.h.

Library :    Use BiDIB.lib.

DLLs :       BiDIB.dll.

Programming notes

If the bitmap has deferent planes follow the following rules:

If the source BMP and mask BMP have different bit per planes than the destination:

first convert the source BMP and the mask BMP to the same bit per planes as the destination BMP. The result will be combined.

The size of the source and the mask BMP must be equal.

 

Other rules:

a.      If the destination BMP is NULL then create a destination BMP based on the source.

b.     If the mask BMP is NULL combine source with destination.

c.      If the mask BMP and destination BMP is NULL then just return the source.