L_ChangeFromDDB

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeFromDDB(hDC, pBitmap, uStructSize, hBitmap, hPalette)

HDC hDC;

/* handle to the device responsible for the conversion */

pBITMAPHANDLE pBitmap;

/* address of the LEAD bitmap handle */

L_UINT uStructSize;

/* size in bytes, of the structure pointed to by pBitmap */

HBITMAP hBitmap;

/* handle to the DDB to be changed */

HPALETTE hPalette;

/* handle to the palette */

Changes a Windows device dependent bitmap (DDB) to a LEAD bitmap. This function results in only one copy of the bitmap, and it invalidates the DDB handle.

Parameter

Description

hDC

Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.

pBitmap

Address of the LEAD bitmap handle.

uStructSize

Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

hBitmap

Handle to the DDB to be changed.

hPalette

Handle to the palette. This value can be NULL if the hDC parameter refers to a device that is greater than 8 bits, or if the bitmap will use the system palette.

Returns

SUCCESS

The function was successful.

< 0

An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare the LEAD bitmap handle, but you should not allocate the bitmap, because the new bitmap handle will point to the previous DDB data after the function is called. (If the bitmap is already allocated, you must free it.)

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_ConvertFromDDB, L_ConvertFromDIB, L_ConvertToDDB, L_ConvertToDIB, L_ChangeFromDIB, L_ChangeToDDB, L_ChangeToDIB

Topics:

Raster Image Functions: Creation, Deletion, and Copying

 

Using DIBs, DDBs, and the Clipboard

Example

For an example, refer to L_ChangeToDDB.