Admin Production ni-theme
Current Publication

AllocBitmapDataEx

LabWindows/CVI

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 obtain the ID of the bitmap object from functions such as NewBitmapEx and GetCtrlBitmap.

Parameters

Input
Name Type Description
bitmapID int ID of the bitmap object that contains the image. You can obtain the ID from functions such as NewBitmapEx and GetCtrlBitmap.
Output
Name Type Description
colorTable int * 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 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 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 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 int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 8.0 and later