virtual L_UINT LPlayBack::Process()
Processes the next state during an animation playback.
A constant that describes the new state of the animation playback engine. For possible values, refer to Animation Playback States.
This function is called in a loop, to continually process the class object's animation playback.
Win32, x64.
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.
// Process Example
L_INT LPlayBack__ProcessExample(L_TCHAR * pszFilename, HWND hWnd)
{
L_INT nRet;
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) */
nRet = BitmapList.Load (pszFilename);
if(nRet != SUCCESS)
return nRet;
/* Set the background bitmap*/
nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")));
if(nRet != SUCCESS)
return nRet;
/* 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 */
nRet = Playback.Create (&LeadBitmap, &BitmapList);
if(nRet != SUCCESS)
return nRet;
if(Playback.IsCreated() == FALSE)
return FAILURE;
do
{
uState = Playback.Process ();
switch(uState)
{
case PLAYSTATE_WAITINPUT:
//Playback.caL_CancelPlaybackWait(hPlayback);
break;
case PLAYSTATE_POSTCLEAR:
case PLAYSTATE_POSTRENDER:
nRet = Playback.GetUpdateRect (&rcUpdate, TRUE);
if(nRet != SUCCESS)
return nRet;
hdc = GetDC(hWnd);
Playback.GetBitmap()->Paint()->SetDC(hdc);
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;
nRet = Playback.GetBitmap()->Paint()->PaintDC();
if(nRet != SUCCESS)
return nRet;
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
nRet = Playback.Destroy (NULL);
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document