LBitmapBase::ConvertToDDB

Summary

Converts an LBitmapBase objects bitmap into a Windows device dependent bitmap (DDB). When this function is completed, there are two copies of the image in memory: the DDB and the original LEAD bitmap. Freeing one will not affect the other.

Syntax

#include "ltwrappr.h"

virtual HBITMAP LBitmapBase::ConvertToDDB(hDC)

Parameters

HDC hDC

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

Returns

This function returns a handle to the DDB, or it returns a NULL if there is an error.

Comments

This function allocates a DDB bitmap and copies the LBitmapBase objects bitmap to the DDB. When you no longer need the DIB, you can free it using the Windows DeleteObject function.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmapBase__ConvertToDDBExample() 
{ 
   L_INT nRet; 
   LBitmapBase MyBitmap,Bitmap2; 
   HDC hDC=GetDC(0); 
   HBITMAP hBitmap; 
 
   nRet =MyBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp"))); 
   if(nRet !=SUCCESS) 
      return nRet; 
   hBitmap=MyBitmap.ConvertToDDB(hDC); 
   nRet =Bitmap2.ConvertFromDDB(hDC, hBitmap, 0); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   ReleaseDC(0,hDC); 
 
   return SUCCESS; 
} 
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.