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 integer 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 integer 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 integer Specifies whether to include the control label (if any) in the bitmap created from the current appearance of the control.
newHeight integer Specifies the desired height of the resultant bitmap.

Use –1 to maintain the same height.
newWidth integer 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 integer 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.