Admin Production ni-theme
Current Publication

GetCtrlDisplayBitmap

LabWindows/CVI

GetCtrlDisplayBitmap

int GetCtrlDisplayBitmap (int panelHandle, int controlID, int includeLabel, int *bitmapID);

Purpose

Creates a bitmap object that contains a screenshot image of the current appearance of a control. You can pass the bitmap ID this function outputs to any function that accepts a bitmap, such as CanvasDrawBitmap or ClipboardPutBitmap.

For example, you can paste a picture of a control onto the system clipboard by calling GetCtrlDisplayBitmap and then passing the bitmap ID to ClipboardPutBitmap.

You can discard the bitmap object by passing the ID to DiscardBitmap.

Supported Controls

You can use GetCtrlDisplayBitmap with all LabWindows/CVI user interface controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
includeLabel int Specifies whether to include the control label (if any) in the image.

Specify a nonzero value or select Yes in the function panel to include the control label.

Specify 0 or select No in the function panel to omit the control label.
Output
Name Type Description
bitmapID int ID that serves as a handle to the bitmap object.

You can pass the ID to functions that accept a bitmap, such as CanvasDrawBitmap and ClipboardPutBitmap.

To discard the bitmap, pass the ID to DiscardBitmap.

Zero is not a valid bitmap ID.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Example

Refer to userint\clipbord.cws for an example of using the GetCtrlDisplayBitmap function.