#include "ltwrappr.h"
static L_INT LChange::ChangeFromWMF(pLBitmap, uStructSize, hWmf, uWidth, uHeight)
LBitmapBase * pLBitmap; |
pointer to a bitmap object |
L_UINT uStructSize; |
size in bytes, of the structure pointed to by pLBitmap |
HMETAFILE hWmf; |
handle to the WMF to be converted |
L_UINT uWidth; |
width |
L_UINT uHeight; |
height |
Changes a Windows metafile (WMF) into a LEAD Technologies bitmap and, if successful, frees the metafile.
Parameter |
Description |
pLBitmap |
Pointer to the bitmap object to be updated with the changed file. |
uStructSize |
Size in bytes, of the structure pointed to by pLBitmap. Use sizeof(BITMAPHANDLE). |
hWmf |
Handle to the WMF to be changed. |
uWidth |
Amount by which to scale the metafiles original width. |
uHeight |
Amount by which to scale the metafiles original height. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
If this function is successful, hWmf is freed.
The metafile can be loaded at the original dimension or scaled by using the uWidth and uHeight parameters.
If uWidth == 0 and uHeight == 0 - the metafile is loaded at the size present in the file.
If uWidth == 0 and uHeight > 0 - the metafile is stretched so that it has the height uHeight (preserving the aspect ratio).
If uWidth > 0 and uHeight == 0 - the metafile is stretched so that it has the width uWidth (preserving the aspect ratio).
If uWidth > 0 and uHeight > 0 - the metafile is stretched so that it has the width uWidth and height uHeight (the aspect ratio is ignored).
Required DLLs and Libraries
LTKRN 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.
This example loads a bitmap, converts it to a WMF, then converts the WMF back to a bitmap.
L_INT LChange__ChangeFromWMFExample(LBitmap LeadBitmap)
{
L_INT nRet;
HMETAFILE hWmf;
LBitmap Tmpbitmap;
/* Load a bitmap, keeping its own bits per pixel */
nRet = Tmpbitmap.Load(MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\Image3.cmp")), 0, ORDER_BGR, NULL, NULL);
if(nRet != SUCCESS)
return nRet;
/* Convert the initial bitmap to a WMF */
hWmf = LChange::ChangeToWMF( &Tmpbitmap );
/* Convert the WMF to create a new LEAD bitmap and preserve the size */
LChange::ChangeFromWMF(&LeadBitmap, sizeof(BITMAPHANDLE), hWmf, 0, 0);
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