Admin Production ni-theme
Current Publication

GetScaledPanelDisplayBitmap

LabWindows/CVI

GetScaledPanelDisplayBitmap

int GetScaledPanelDisplayBitmap (int panelHandle, int scope, Rect area, int newHeight, int newWidth, int *bitmapID);

Purpose

Creates a bitmap object that contains a screenshot image of the current appearance of a panel. newHeight and newWidth determine the dimensions of the bitmap. The image stretches or shrinks to fit the specified dimensions.

You can use GetScaledPanelDisplayBitmap to retrieve a scaled bitmap that you can pass to ClipboardPutBitmap. From the clipboard, you can paste the picture of the control into another application in the size you want for that application.

To discard the bitmap object, pass its 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.
newHeight int The height, in pixels, of the bitmap image.

Values: 1 to 32,767, or pass –1 to use the height of the panel on the screen.

If you pass VAL_ENTIRE_OBJECT for the area parameter, newHeight specifies the exact height of the scaled bitmap. Otherwise, GetScaledPanelDisplayBitmap calculates the bitmap height as follows:

bitmap height = newHeight/height of panel on screen × area.height
newWidth int The width, in pixels, of the bitmap image.

Values: 1 to 32,767, or pass –1 to use the width of the panel on the screen.

If you pass VAL_ENTIRE_OBJECT for the area parameter, newWidth specifies the exact width of the scaled bitmap. Otherwise, GetScaledPanelDisplayBitmap calculates the bitmap width as follows:

bitmap width = newWidth/width of panel on screen × area.width
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 5.0 and later