virtual HBITMAP LBitmapBase::ConvertToDDB(hDC)
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.
Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.
This function returns a handle to the DDB, or it returns a NULL if there is an error.
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.
Win32, x64.
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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document