L_INT LAnimationWindow::EnableTransparency(bEnable=TRUE, clrTransparent=RGB(0,0,0), nIndex=ANIM_ALL_ITEMS)
Sets the transparency parameters to be used with playback for the bitmap item at position nIndex inside the bitmap list.
Flag that indicates whether to enable or disable transparency. Possible values are:
Value | Meaning |
---|---|
TRUE | Enable transparency. |
FALSE | Disable transparency. |
COLORREF that represents the transparent color to use for animation playback.
Position of the bitmap list item. Possible values are:
Value | Meaning |
---|---|
ANIM_ALL_ITEMS | [-1] Set the delay for all items in the bitmap list |
>=0 | Set the delay only for the specified item |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Passing nIndex = ANIM_ALL_ITEMS will cause all the bitmaps in the list to be set.
Win32, x64.
The following example will change the transparency information
for odd numbered items in the animation list using EnableTransparency,
then reads the new information using IsTransparencyEnabled.
L_INT LAnimationWindow_EnableTransparencyExample(HWND hWndParent)
{
L_INT nRet;
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded
LAnimationWindow MyAnimation;
MyAnimation.SetFileName(MAKE_IMAGE_PATH(TEXT("eye.gif")));
nRet = MyAnimation.Load();
if (nRet==SUCCESS)
{
L_BOOL bEnabled;
COLORREF crTranparent;
L_UINT i;
MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//change the transparency...
for (i=0; i<MyAnimation.GetCount(); i++)
{
if (i%2)
{
nRet = MyAnimation.EnableTransparency(TRUE, RGB(i*35 % 256, i*50 % 256, i*75 % 256), i);
if(nRet != SUCCESS)
return nRet;
}
}
for (i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];
//get current transparenct info for each bitmap...
nRet = MyAnimation.IsTransparencyEnabled(&bEnabled, &crTranparent, i);
if(nRet != SUCCESS)
return nRet;
wsprintf(szStr,TEXT("Bitmap[%d] Transparency Info: Enabled= %s Color = &H%08X"),i, (bEnabled?TEXT("YES"):TEXT("NO")), crTranparent);
MessageBox(hWndParent, szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
else
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document