LPlayBack::GetDelay

#include "ltwrappr.h"

virtual L_UINT32 LPlayBack::GetDelay(L_VOID);

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

Returns

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

Required DLLs and Libraries

LTDIS
LTFIL

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:

Class Members

Topics:

Raster Image Functions: Creating and Maintaining Lists of Images

 

Implementing Animation

Example

/* This example cancels the playback wait state if the current delay is more than 10 milliseconds. */
void GetDelaySample(HWND hWnd, LBitmapBase *pTargetBitmap, LBitmapList L_FAR *pBitmapList)
{
   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 */
   PlayBack.Create(pTargetBitmap, pBitmapList);
   do
   {
      uState = PlayBack.Process ();
      switch(uState)
      {
      case PLAYSTATE_WAITDELAY:
         uDelay = PlayBack.GetDelay ();
         if (uDelay > 10)
             PlayBack.CancelWait ();
         break;
      case PLAYSTATE_POSTRENDER:
         PlayBack.GetUpdateRect (&rcUpdate, TRUE);
         hdc = GetDC(hWnd);
         PlayBack.GetBitmap()->SetClipSrcRect(&rcUpdate);
         PlayBack.GetBitmap()->SetDstRect(&rcDisplay);
         PlayBack.GetBitmap()->SetClipDstRect(&rcDisplay);
         PlayBack.GetBitmap()->Paint()->SetDC(hdc);
         PlayBack.GetBitmap()->CreatePaintPalette (hdc);
         PlayBack.GetBitmap()->Paint()->PaintDC();
         ReleaseDC(hWnd, hdc);
         break;
      }
   }while(uState != PLAYSTATE_END);

}