LPlayBack::Process

#include "ltwrappr.h"

virtual L_UINT LPlayBack::Process(L_VOID)

Processes the next state during an animation playback.

Returns

A constant that describes the new state of the animation playback engine. For possible values, refer to Animation Playback States.

Comments

This function is called in a loop, to continually process the class object's animation playback.

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

// Process Example
/* This example loads a bitmap list from an animated GIF or AVI file.
It then plays the animation, using the current bitmap as the target. */
void TestAnimate(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
   LBitmapList BitmapList; /* Bitmap list */
   LBitmapBase LeadBitmap; /* Bitmap handle for the loaded image. */
   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 */

   /* Create the bitmap list from the input file (GIF or AVI) */
   BitmapList.Load (pszFilename);
   /* Get a copy of the first image's bitmap handle */
   LeadBitmap = BitmapList[0];
   /* Use the client area as the display rectangle, 
   assuming that the window is properly sized */
   GetClientRect(hWnd,&rcDisplay);
 /* Create the target bitmap that is used for playback */
   /* Create and run the playback */
   Playback.Create (&LeadBitmap, &BitmapList);
   if(Playback.IsCreated() == FALSE)
      return;
   do
   {
      uState = Playback.Process ();
      switch(uState)
      {
      case PLAYSTATE_WAITINPUT:
            //Playback.caL_CancelPlaybackWait(hPlayback);
            break;
      case PLAYSTATE_POSTCLEAR:
      case PLAYSTATE_POSTRENDER:
         Playback.GetUpdateRect (&rcUpdate, TRUE);
         hdc = GetDC(hWnd);

         Playback.GetBitmap()->Paint()->SetDC(hdc);
         Playback.GetBitmap()->SetClipSrcRect (&rcUpdate);
         Playback.GetBitmap()->SetDstRect(&rcDisplay);
         Playback.GetBitmap()->SetClipDstRect (&rcDisplay);
         Playback.GetBitmap()->Paint()->PaintDC();
         ReleaseDC(hWnd, hdc);
         break;
      }
   } while(uState != PLAYSTATE_END);

   /* Clean up */
   // No need to call destroy it is only for sample purposes
   // the destructor will call destroy if it was not called here
   Playback.Destroy (NULL);
}