LAnimationWindow::EnableTransparency
#include "ltwrappr.h"
L_INT LAnimationWindow::EnableTransparency(bEnable=TRUE, clrTransparent=RGB(0,0,0), nIndex=ANIM_ALL_ITEMS)
L_BOOL bEnable; |
/* flag that indicates whether to enable transparency */ |
COLORREF clrTransparent; |
/* transparent color */ |
L_UINT nIndex; |
/* position of the bitmap list item */ |
Sets the transparency parameters to be used with playback for the bitmap item at position nIndex inside the bitmap list.
Parameter |
Description |
|
bEnable |
Flag that indicates whether to enable or disable transparency. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
Enable transparency. |
|
FALSE |
Disable transparency. |
clrTransparent |
COLORREF that represents the transparent color to use for animation playback. |
|
nIndex |
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 |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
Passing nIndex = ANIM_ALL_ITEMS will cause all the bitmaps in the list to be set.
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
Functions: |
LAnimationWindow::LAnimationWindow, LAnimationWindow::IsTransparencyEnabled, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members |
Topics: |
|
|
Example
/*
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.
*/
#include <ltlck.h> //Unlock support
L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded
LAnimationWindow MyAnimation;
WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));
if (MyAnimation.Load()==SUCCESS)
{
L_BOOL bEnabled;
COLORREF crTranparent;
MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//change the transparency...
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
if (i%2)
MyAnimation.EnableTransparency(TRUE, RGB(i*35 % 256, i*50 % 256, i*75 % 256), i);
}
for (i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];
//get current transparenct info for each bitmap...
MyAnimation.IsTransparencyEnabled(&bEnabled, &crTranparent, i);
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);
}
}
}