Admin Production ni-theme
Current Publication

GetPanelDisplayBitmap

LabWindows/CVI

GetPanelDisplayBitmap

int GetPanelDisplayBitmap (int panelHandle, int scope, Rect area, int *bitmapID);

Purpose

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

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

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

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.
scope int Specifies which portions of the panel to copy to the bitmap.

Select one of the following values:

VAL_VISIBLE_AREA—Copies the visible area of the panel to the bitmap, including the frame, menu bar, and scroll bars.

VAL_FULL_PANEL—Copies the entire contents of the panel to the bitmap, excluding the frame, menu bar, and scroll bars. This includes contents that might currently be scrolled off the visible area.

Note Note  If you select VAL_VISIBLE_AREA, the panel title bar and frame have the appearance of child panels in the bitmap. This behavior occurs for both top-level panels and child panels.
Regardless of the scope, objects within child panels are clipped to the frame of the child panel.
area Rect Restricts the area of the panel to copy into the bitmap.

You must pass a Rect structure. The rectangle coordinates, specified in pixels, are relative to the upper-left corner of the panel, directly below the title bar, before the panel is scrolled.

Use VAL_ENTIRE_OBJECT if you do not want to restrict the area to copy.
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

Examples

Refer to the following examples that use the GetPanelDisplayBitmap function:

  • apps\uirview\uirview.cws

    Open example
  • userint\clipbord.cws

    Open example