Copies image data from the clipboard to a specified bitmap. The image on the clipboard must be a DIB, DDB, or aWMF.
#include "l_bitmap.h"
L_LTDIS_API L_BOOL L_CopyFromClipboard(hWnd, pBitmap, uStructSize)
Handle to the active window.
Pointer to the bitmap handle referencing the bitmap to fill. This function will allocate the storage to hold the image.
Size in bytes, of the structure pointed to by pBitmap
, for versioning. Use sizeof(BITMAPHANDLE).
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The LEAD bitmap is referenced by the pointer to the bitmap handle. The bitmap will contain the same width, height, and bits per pixel as the image contained in the clipboard. The color order field in the bitmap handle will be set to ORDER_BGR. If the copied image is not in BGR order, it is up to you to change its color order using L_ColorResBitmap.
The destination bitmap must not be allocated before this function is called. If the bitmap is already allocated, you must free it and initialize the bitmap handle.
To determine whether a region was pasted, you must call L_BitmapHasRgn(pBitmap).
Win32, x64.
For a complete sample code, refer to the FRAME.C module of the DEMO example.
This example loads a bitmap using clipboard data, if available.
L_BOOL CopyFromClipboardExample(L_HWND hWnd, pBITMAPHANDLE pLeadBitmap, L_INT * pRet)
{
if (L_ClipboardReady())
{
/* Copy the bitmap from the clipboard */
if (pLeadBitmap->Flags.Allocated)
L_FreeBitmap(pLeadBitmap);
*pRet = L_CopyFromClipboard(hWnd, pLeadBitmap, sizeof(BITMAPHANDLE));
return(TRUE);
}
else
{
return(FALSE);
}
}
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