LPlayBack::GetDelay

Summary

Gets the time remaining in the current wait state of an animation playback.

Syntax

#include "ltwrappr.h"

virtual L_UINT32 LPlayBack::GetDelay()

Returns

The number of milliseconds remaining for the current animation playback frame.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example cancels the playback wait state if the current delay is more than 10 milliseconds.

L_INT LPlayBack__GetDelayExample(HWND hWnd, LBitmapBase *pTargetBitmap, LBitmapList *pBitmapList) 
 
{ 
   L_INT nRet; 
   LPlayBack PlayBack; /* Animation playback */ 
   L_UINT uState; /* Next state in the playback */ 
   RECT rcUpdate; /* Source clipping rectangle used in playback */ 
   RECT rcDisplay; /* Display rectangle used in playback */ 
   HDC hdc; /* Device context of the current window */ 
   L_UINT32 uDelay; /* Variable to be updated with the time left */ 
 
   /* Use the client area as the display rectangle */ 
   GetClientRect(hWnd,&rcDisplay); 
 
   /* Create and run the playback */ 
   nRet = PlayBack.Create(pTargetBitmap, pBitmapList); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   do 
 
   { 
 
      uState = PlayBack.Process (); 
 
      switch(uState) 
 
      { 
 
      case PLAYSTATE_WAITDELAY: 
 
         uDelay = PlayBack.GetDelay (); 
 
        if (uDelay > 10) 
        { 
           nRet = PlayBack.CancelWait (); 
           if(nRet != SUCCESS) 
              return nRet; 
        } 
        break; 
 
      case PLAYSTATE_POSTRENDER: 
 
         nRet = PlayBack.GetUpdateRect (&rcUpdate, TRUE); 
         if(nRet != SUCCESS) 
            return nRet; 
 
         hdc = GetDC(hWnd); 
 
         nRet = PlayBack.GetBitmap()->SetClipSrcRect(&rcUpdate); 
         if(nRet != SUCCESS) 
            return nRet; 
 
         nRet = PlayBack.GetBitmap()->SetDstRect(&rcDisplay); 
         if(nRet != SUCCESS) 
            return nRet; 
 
         nRet = PlayBack.GetBitmap()->SetClipDstRect(&rcDisplay); 
         if(nRet != SUCCESS) 
            return nRet; 
 
         PlayBack.GetBitmap()->Paint()->SetDC(hdc); 
 
         PlayBack.GetBitmap()->CreatePaintPalette (hdc); 
 
         nRet = PlayBack.GetBitmap()->Paint()->PaintDC(); 
         if(nRet != SUCCESS) 
            return nRet; 
 
         ReleaseDC(hWnd, hdc); 
 
         break; 
 
      } 
 
   }while(uState != PLAYSTATE_END); 
 
   return SUCCESS; 
 
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.