# GetCtrlBitmap

int GetCtrlBitmap (int panelHandle, int controlID, int imageID, int *bitmapID);

## Purpose

Obtains a bitmap image from a control and stores it in a bitmap object. You can pass the bitmap ID this function outputs to any function that accepts a bitmap, such as CanvasDrawBitmap or ClipboardPutBitmap.

You can use this function on images you create using functions such as DisplayImageFile, InsertListItem, PlotBitmap, SetImageBits, or SetCtrlAttribute with the ATTR_IMAGE_FILE attribute.

You can discard the bitmap object by passing 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.
controlID | integer | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
imageID | integer | For picture rings, the zero-based index of an image in the ring. For graphs, the plot handle you obtain from PlotBitmap. For tree controls, the image index you obtain from AddTreeImage. For picture controls, picture buttons, and canvas controls, this parameter is ignored. For tab controls, the zero-based index of the tab page that contains the image.
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