LChange::ChangeToDDB

Summary

Changes an LBitmapBase object's internal LEAD bitmap handle to a Windows Device Dependent Bitmap (DDB). This function results in only one copy of the bitmap, and it invalidates the LEAD bitmap handle.

Syntax

#include "ltwrappr.h"

static HBITMAP LChange::ChangeToDDB(hDC, pLBitmap)

Parameters

HDC hDC

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

LBitmapBase * pLBitmap

Pointer to the bitmap object referencing the bitmap to change.

Returns

Value Meaning
>0 HBITMAP.
0 An error occurred.

Comments

When you no longer need the DDB, you can free it using the Windows DeleteObject() function.

If this function fails, the return value is a NULL HBITMAP. This can happen if the image is too large for the Windows API functions that LEADTOOLS uses internally. To get more information about why the Windows API functions may have failed, you can use the Windows API GetLastError.

/* Change the initial bitmap to a DDB */ 
hDDB = LChange::ChangeToDDB( hDC, &MyBitmap ); 
if(!hDDB) 
{ 
   DWORD dwRet = GetLastError(); 
   /* process the error code here */ 
} 

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For an example, refer to LChange::ChangeFromDDB.

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.