L_GetPlaybackDelay

Summary

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

Syntax

#include "l_bitmap.h"

L_LTDIS_API L_INT L_GetPlaybackDelay(hPlayback, puDelay)

Parameters

HPLAYBACK hPlayback

Handle that references the animation playback.

L_UINT *puDelay

Address of the variable to be updated with the number of milliseconds remaining.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

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

L_INT GetPlaybackDelayExample(L_HWND hWnd, pBITMAPHANDLE pTargetBitmap, HBITMAPLIST hList) 
{ 
   L_INT       nRet; 
   HPLAYBACK   hPlayback;        /* 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 */ 
   HPALETTE    hPalette = NULL;  /* Temporary copy of the current system palette */ 
   HPALETTE    hpalPaint = NULL; 
   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 = L_CreatePlayback(&hPlayback, pTargetBitmap, hList); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   do 
   { 
      nRet = L_ProcessPlayback(hPlayback, &uState); 
      if (nRet != SUCCESS) 
         return nRet; 
 
      switch (uState) 
      { 
      case PLAYSTATE_WAITDELAY: 
         nRet = L_GetPlaybackDelay(hPlayback, &uDelay); 
         if (nRet != SUCCESS) 
            return nRet; 
 
         if (uDelay > 10) 
         { 
            nRet = L_CancelPlaybackWait(hPlayback); 
            if (nRet != SUCCESS) 
               return nRet; 
         } 
         break; 
 
      case PLAYSTATE_POSTRENDER: 
         nRet = L_GetPlaybackUpdateRect(hPlayback, &rcUpdate, TRUE); 
         if (nRet != SUCCESS) 
            return nRet; 
 
         hdc = GetDC(hWnd); 
         if (hpalPaint) 
         { 
            hPalette = SelectPalette(hdc, hpalPaint, TRUE); 
            RealizePalette(hdc); 
         } 
 
         nRet = L_PaintDC(hdc, pTargetBitmap, NULL, &rcUpdate, &rcDisplay, &rcDisplay, SRCCOPY); 
         if (nRet != SUCCESS) 
            return nRet; 
 
         if (hpalPaint) 
            SelectPalette(hdc, hPalette, TRUE); 
 
         ReleaseDC(hWnd, hdc); 
         break; 
      } 
   } while (uState != PLAYSTATE_END); 
 
   /* Clean up */ 
   nRet = L_DestroyPlayback(hPlayback, NULL); 
 
   return nRet; 
} 

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

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