Admin Production ni-theme
Current Publication

SaveCtrlDisplayToFile

LabWindows/CVI

SaveCtrlDisplayToFile

int SaveCtrlDisplayToFile (int panelHandle, int controlID, int includeLabel, int newHeight, int newWidth, const char path[]);

Purpose

Creates a bitmap "snapshot" of the specified control, scales it according to the newHeight and newWidth parameters, and then saves it to file.

Parameters

Input
Name Type Description
panelHandle int The specifier for a particular panel that is currently in memory.

This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function.
controlID int The defined constant (located in the UIR header file) that was assigned to the control in the User Interface Editor or the ID returned by the NewCtrl or DuplicateCtrl function.
includeLabel int Specify a nonzero value or select Yes in the function panel to include the control label, if any, in the bitmap created from the current appearance of the control.

Specify 0 or select No in the function panel to omit the control label.
newHeight int Specifies the desired height of the resultant bitmap.

Use –1 to maintain the same height.
newWidth int Specifies the desired width of the resultant bitmap.

Use –1 to maintain the same width.
path const char[] The pathname of a file. If it is not an absolute pathname, the pathname is relative to the current working directory.

Return Value

Name Type Description
status int Returns 0 if the function succeeded or a negative error code if the function failed.

The possible negative error codes are:

–1 to –999 A User Interface Library error code. (Constants are available in userint.h.)

You can call the GetGeneralErrorString function in the toolbox.fp instrument driver to obtain a description of any of these error codes.

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later

Example

Refer to activex\word\wordrpt.cws for an example of using the SaveCtrlDisplayToFile function.