LAnimationWindow::IsValidAnimation
#include "ltwrappr.h"
L_BOOL LAnimationWindow::IsValidAnimation(L_VOID) const
Determines whether the LAnimationWindow object is valid.
Returns
TRUE |
The LAnimationWindow object is valid. |
FALSE |
The LAnimationWindow object is not valid. |
Comments
Before you can use any of the animation playback functions, a valid LBitmapList object must be associated with the class object. Until you have associated a bitmap list with the LAnimationWindow object, the object is considered invalid.
You can associate a bitmap list with the LAnimationWindow object using the constructor(LAnimationWindow::LAnimationWindow), LAnimationWindow::SetBitmapList, or LAnimationWindow::Load.
Note: This function also determines whether the current file is an animated GIF or AVI file. If the file contains more than one page, the function will return TRUE.
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: |
Example
#include < ltlck.h> //Unlock support
L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
//make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support
L_INT nRetCode;
LBitmap Bitmap;
LBitmapList MyBitmapList;
LAnimationWindow MyAnimation;
L_TCHAR L_FAR * pszFiles[] = {TEXT(" image1.cmp"),
TEXT("image2.cmp"),
TEXT(" image3.cmp") };
MyBitmapList.Create();
for (int i = 0 ; i<3; i++)
{
nRetCode = Bitmap.Load(pszFiles[i]);
if (nRetCode !=SUCCESS)
{
MessageBox(hWndParent,
TEXT("Failed to load file"),TEXT("Error!"),MB_OK |
MB_ICONSTOP);
return;
}
MyBitmapList.InsertItem(&Bitmap);
}
MyAnimation.SetBitmapList(&MyBitmapList);
if (MyAnimation.IsValidAnimation())
{
MyAnimation.CreateWnd(hWndParent,0,
WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,800,600);
MyAnimation.SetDelay(1000);
MyAnimation.SetBackgroundColor(RGB(255,255,255));
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
MessageBox(hWndParent, TEXT("Press
Ok to terminate"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}
}