# AllocBitmapDataEx

int AllocBitmapDataEx (int bitmapID, int **colorTable, unsigned char **bits, unsigned char **mask, unsigned char **alpha);

## Purpose

Allocates the buffers you pass to GetBitmapDataEx. AllocBitmapDataEx is similar to AllocBitmapData, except that AllocBitmapDataEx supports alpha-channel transparency. If you use GetBitmapInfoEx, you must allocate the buffers yourself. You must free the buffers when you are done with them. Use the ANSI C free function to free the buffers.

You can use this function with bitmaps created with NewBitmapEx, GetBitmapFromFile, GetCtrlBitmap, ClipboardGetBitmap, GetCtrlDisplayBitmap, GetPanelDisplayBitmap, GetScaledPanelDisplayBitmap, GetScaledCtrlDisplayBitmap, or DuplicateBitmap.

## Parameters

Input
Name | Type | Description
bitmapID | integer | ID of the bitmap object that contains the image. Obtain the ID from NewBitmapEx, GetBitmapFromFile, GetCtrlBitmap, ClipboardGetBitmap, GetCtrlDisplayBitmap, GetPanelDisplayBitmap, GetScaledPanelDisplayBitmap, GetScaledCtrlDisplayBitmap, or DuplicateBitmap.
Output
Name | Type | Description
colorTable | pointer to integer | Pointer variable in which to store the address of the allocated color table buffer. If the pixel depth of the image is greater than 8, this function sets colorTable to NULL. If you do not want this function to allocate the color table buffer, pass NULL for this parameter.
bits | pointer to unsigned char | Pointer variable in which to store the address of the allocated bits data buffer. If you do not want this function to allocate the bits data buffer, pass NULL for this parameter.
mask | pointer to unsigned char | Pointer variable in which to store the address of the allocated mask buffer. If the image does not have a mask, this function sets mask to NULL. If you do not want this function to allocate the mask buffer, pass NULL for this parameter.
alpha | pointer to unsigned char | Pointer variable in which to store the address of the allocated alpha-channel buffer. If the image does not have an alpha channel, this function sets alpha to NULL. If you do not want this function to allocate the alpha channel buffer, pass NULL for this parameter.

## 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