virtual L_INT LBitmapBase::SetAlpha(LBitmapAlpha)
Replaces the class object's existing alpha channel data or creates new alpha channel data in the class object's bitmap using the specified class object's bitmap.
A bitmap object that has an allocated bitmap to be set as the alpha channel for the calling objects bitmap.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
Typically, an alpha channel contains a mask that is used for transparency. This function, together with the LEADTOOLS region processing functions, lets you use the alpha channel to implement transparency.
Only 16- and 32-bit images can have an alpha channel. If pBitmap references a bitmap of any other color resolution, this function converts the pBitmap bitmap to 32-bit before it replaces the alpha channel. (If you want 16-bit, you should change it using LBitmapBase::ColorRes, if necessary, before calling this function.)
The pAlpha bitmap does not have to be grayscale. This function converts the data from the pAlpha bitmap to the necessary grayscale or 1-bit format as it replaces the alpha channel in pBitmap. (The pAlpha bitmap, itself, remains unchanged.)
Note: The LBitmapAlpha parameter is passed by reference, and is a required parameter.
This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.
if(nRet !=SUCCESS)//load at 32 bit per pixel
return nRet;//load at 32 bit per pixel
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries