Determines whether the LAnimationWindow object is valid.
#include "ltwrappr.h"
L_BOOL LAnimationWindow::IsValidAnimation() const
Value | Meaning |
---|---|
TRUE | The LAnimationWindow object is valid. |
FALSE | The LAnimationWindow object is not valid. |
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 file. If the file contains more than one page, the function will return TRUE.
Win32, x64.
L_INT LAnimationWindow_IsValidAnimationExample(HWND hWndParent)
{
L_INT nRet;
LBase::LoadLibraries(LT_ALL_LEADLIB);
//make sure all libraries are loaded
LBitmap Bitmap;
LBitmapList MyBitmapList;
LAnimationWindow MyAnimation;
L_TCHAR * pszFiles[] = {MAKE_IMAGE_PATH(TEXT("image1.cmp")),
MAKE_IMAGE_PATH(TEXT("image2.cmp")),
MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\Image3.cmp"))};
MyBitmapList.Create();
for (int i = 0 ; i<3; i++)
{
nRet = Bitmap.Load(pszFiles[i]);
if (nRet !=SUCCESS)
{
MessageBox(hWndParent, TEXT("Failed to load file"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
return nRet;
}
nRet = MyBitmapList.InsertItem(&Bitmap);
if(nRet != SUCCESS)
return nRet;
}
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));
nRet = MyAnimation.PlayAnimation();
if(nRet != SUCCESS)
return nRet;
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
MessageBox(hWndParent, TEXT("Press Ok to terminate"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}
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