#include "ltwrappr.h"
static L_INT LChange::ChangeFromDDB(hDC, uStructSize, pLBitmap, hBitmap, hPalette)
HDC hDC; |
handle to the device responsible for the conversion |
L_UINT uStructSize; |
size in bytes, of the structure pointed to by pLBitmap |
LBitmapBase * pLBitmap; |
address of the LEAD bitmap object |
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. The new LEAD bitmap is stored in the specified LBitmapBase object's internal LEAD bitmap handle. 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. |
uStructSize |
Size in bytes, of the structure pointed to by pLBitmap. Use sizeof(BITMAPHANDLE). |
pLBitmap |
Address of the LEAD bitmap object. |
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. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
After calling this function, the class object's internal LEAD bitmap handle will point to the previous DDB data.
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. |
Win32, x64.
Functions: |
LBitmapBase::ConvertFromDDB, LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDDB, LBitmapBase::ConvertToDIB,, LChange::ChangeToDDB, Class Members |
Topics: |
|
|
L_INT LChange__ChangeFromDDBExample()
{
L_INT nRet;
LBitmapBase Bitmap;
HBITMAP hBitmap;
HDC hDC;
hDC=GetDC(NULL);
nRet = Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")));
if(nRet != SUCCESS)
return nRet;
hBitmap=LChange::ChangeToDDB(hDC,&Bitmap);
if(hBitmap)
LBase::DisplayError(NULL,TEXT("Successful converting from LEAD Bitmap to DDB Bitmap"));
nRet = Bitmap.Free();
if(hBitmap)
{
nRet = LChange::ChangeFromDDB(hDC,&Bitmap, sizeof(BITMAPHANDLE),hBitmap,NULL);
if(nRet != SUCCESS)
return nRet;
if(Bitmap.IsAllocated())
{
LBase::DisplayError(NULL,TEXT("Successful converting DDB Bitmap to LEAD Bitmap"));
}
else
LBase::DisplayErrorFromList(NULL);
ReleaseDC(NULL,hDC);
}
else
LBase::DisplayError(NULL,TEXT("Cannot Load Bitmap from resource"));
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