LBitmapBase::CreateAlphaBitmap
#include "ltwrappr.h"
virtual L_INT LBitmapBase::CreateAlphaBitmap(LBitmapSrc)
LBitmapBase& LBitmapSrc; |
/* the source class object */ |
Creates an alpha bitmap from the alpha channel of another class object's bitmap.
Parameter |
Description |
LBitmapSrc |
The source class object from which to create the alpha bitmap. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
Call this function to create an alpha bitmap from the alpha channel of another class object's bitmap.
Note: |
The LBitmapSrc parameter is passed by reference, and is a required parameter. |
Required DLLs and Libraries
LTDIS For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Elements: |
LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LBitmapBase::Free, LBitmapBase::Create, Class Members |
Topics: |
|
|
Example
The following function checks if an image has a useful alpha channel bitmap.
void CheckAlphaBitmap(L_TCHAR* pszImageFile)
{
LBitmapBase Bitmap, AlphaBitmap;
LBitmapRgn Region;
L_UINT32 uArea;
Bitmap.Load(pszImageFile,
0, ORDER_BGR);
AlphaBitmap.CreateAlphaBitmap(Bitmap);
Region.SetBitmap(&AlphaBitmap);
Region.SetRgnCombineMode(L_RGN_SETNOT);
Region.SetRgnColor(RGB(0,
0, 0) /* Black */);
Region.GetRgnArea(&uArea);
if (uArea != 0)
MessageBox(NULL, TEXT("The image
has a useful alpha bitmap."), TEXT("Test"), MB_OK);
}