LAnimationWindow::IsValidAnimation

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsValidAnimation() const

Determines whether the LAnimationWindow object is valid.

Returns

Value Meaning
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 file. If the file contains more than one page, the function will return TRUE.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Example

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 Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.