# 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 | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
scope | integer | 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. 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 | integer | 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 | integer | 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 | integer | ID that serves as a handle to the bitmap object. You can pass the ID to CanvasDrawBitmap, ClipboardPutBitmap, or any other function that accepts a bitmap. To discard the bitmap, pass the ID to DiscardBitmap.

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success