L_CopyToClipboard
#include "l_bitmap.h"
L_INT EXT_FUNCTION L_CopyToClipboard(hWnd, pBitmap, uFlags)
HWND hWnd; |
/* handle to the active window */ |
pBITMAPHANDLE pBitmap; |
/* pointer to the bitmap handle */ |
L_UINT uFlags; |
/* indicates how image data is placed on the clipboard */ |
Copies the RGB or raster image data from a specified bitmap to the clipboard. With this extended function, you can control how image data is placed on the clipboard.
Parameter |
Description |
|
hWnd |
Handle to the active window. |
|
pBitmap |
Pointer to the bitmap handle referencing the bitmap to be copied. |
|
uFlags |
Indicates how image data is placed on the clipboard. You can use a bitwise OR ( | ) to pass more than one value. Valid values are: |
|
|
Value |
Meaning |
|
COPY2CB_EMPTY |
[0x0001] Empty the clipboard before copying data to it. |
|
COPY2CB_DIB |
[0x0002] Copy DIB data to the clipboard. |
|
COPY2CB_DDB |
[0x0004] Copy DDB data to the clipboard. |
|
COPY2CB_PALETTE |
[0x0008] Copy palette data to the clipboard. |
|
COPY2CB_RGN |
[0x0010] Copy the bitmap's region to the clipboard. |
|
If you specify all of the values it is the same as using the L_CopyToClipboard function. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
The clipboard will contain the same width, height, bits per pixel, and color order as the image in the bitmap.
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. |
Platforms
Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.
See Also
Functions: |
|
|
|
Topics: |
Example
/* This example loads a bitmap, copies only the DIB data to the clipboard,
and deletes the original bitmap */
void CopyDIB(HWND hWnd)
{
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap, keeping its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Copy the bitmap to the clipboard */
L_CopyToClipboard (hWnd, &LeadBitmap, COPY2CB_EMPTY | COPY2CB_DIB);
/* Delete the original bitmap, leaving the copy in the clipboard */
L_FreeBitmap(&LeadBitmap);
}