# SavePanelDisplayToFile

int SavePanelDisplayToFile (int panelHandle, int scope, Rect area, int newHeight, int newWidth, const char path[]);

## Purpose

Creates a bitmap "snapshot" of the specified panel, 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.
scope | integer | Specifies whether to use the visible area or the full panel for the bitmap created from the panel display.
area | Rect | Use this parameter to restrict the area of the panel scaled and copied 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 scaled. Use the VAL_ENTIRE_OBJECT macro if you do not want to restrict the area scaled and copied.
newHeight | integer | If you pass VAL_ENTIRE_OBJECT for the area parameter, this parameter specifies the desired height of the resultant bitmap. (If you want to maintain the same height, pass –1.) Otherwise, the resultant height equals (new height/initial height) × area height
newWidth | integer | If you pass VAL_ENTIRE_OBJECT for the area parameter, this parameter specifies the desired width of the resultant bitmap. (If you want to maintain the same width, pass –1.) Otherwise, the resultant width equals (new width/initial width) × area 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.