Clears the update rectangle used for the class object's animation playback, leaving an empty rectangle.
#include "ltwrappr.h"
virtual L_INT LPlayBack::ClearUpdateRect()
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Win32, x64.
This example uses ClearUpdateRect to avoid painting odd numbered bitmaps.
L_INT LPlayBack__ClearUpdateRectExample(HWND hWnd)
{
L_INT nRet;
// this will call the default constructor
LBitmap LeadBitmap;
LPlayBack PlayBack;
HDC hDC;
HPALETTE hPalette;
L_UINT uState, uIndex;
RECT rcClientRect, rcUpdate;
L_INT nCounter = 0;
GetClientRect(hWnd, &rcClientRect);
nRet = LeadBitmap.Create (500, 500,8);
if(nRet != SUCCESS)
return nRet;
nRet = PlayBack.Create (&LeadBitmap);
if(nRet != SUCCESS)
return nRet;
nRet = LeadBitmap.Load (MAKE_IMAGE_PATH(TEXT("image1.cmp")), 8);
if(nRet != SUCCESS)
return nRet;
nRet = PlayBack.Append(&LeadBitmap);
if(nRet != SUCCESS)
return nRet;
nRet = LeadBitmap.Load (MAKE_IMAGE_PATH(TEXT("image2.cmp")), 8);
if(nRet != SUCCESS)
return nRet;
nRet = PlayBack.Append(&LeadBitmap);
if(nRet != SUCCESS)
return nRet;
nRet = LeadBitmap.Load (MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\Image3.cmp")), 8);
if(nRet != SUCCESS)
return nRet;
hDC = GetDC(hWnd);
hPalette = LeadBitmap.CreatePaintPalette (hDC);
hPalette = LeadBitmap.DupPalette();
SelectPalette( hDC, hPalette, TRUE );
RealizePalette(hDC);
nRet = PlayBack.Append(&LeadBitmap);
if(nRet != SUCCESS)
return nRet;
uState = PlayBack.GetState();
while(uState != PLAYSTATE_END)
{
uState = PlayBack.Process();
switch(uState)
{
case PLAYSTATE_WAITINPUT:
nRet = PlayBack.CancelWait();
if(nRet != SUCCESS)
return nRet;
break;
case PLAYSTATE_POSTCLEAR:
case PLAYSTATE_POSTRENDER:
uIndex = PlayBack.GetIndex ();
if(uIndex % 2)
{
nRet = PlayBack.ClearUpdateRect ();
if(nRet != SUCCESS)
return nRet;
}
nRet = PlayBack.GetUpdateRect(&rcUpdate, TRUE);
if(nRet != SUCCESS)
return nRet;
nRet = PlayBack.GetBitmap()->SetClipSrcRect(&rcUpdate);
if(nRet != SUCCESS)
return nRet;
nRet = PlayBack.GetBitmap()->SetDstRect(&rcClientRect);
if(nRet != SUCCESS)
return nRet;
nRet = PlayBack.GetBitmap()->SetClipDstRect(&rcClientRect);
if(nRet != SUCCESS)
return nRet;
PlayBack.GetBitmap()->Paint()->SetDC(hDC);
PlayBack.GetBitmap()->CreatePaintPalette (hDC);
nRet = PlayBack.GetBitmap()->Paint()->PaintDC();
if(nRet != SUCCESS)
return nRet;
break;
}
nCounter = PlayBack.GetIndex();
}
ReleaseDC(hWnd, hDC);
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