virtual L_VOID LAnimationWindow::AnimateEvent(nEvent, nFrameNumber)
Informs you of Animation events.
The animation event. Possible values are:
Value | Meaning |
---|---|
EVENT_MOVE_FIRST | LAnimationWindow::MoveFirstFrame was called. |
EVENT_MOVE_LAST | LAnimationWindow::MoveLastFrame was called. |
EVENT_MOVE_NEXT | LAnimationWindow::MoveNextFrame was called. |
EVENT_MOVE_PREV | LAnimationWindow::MovePreviousFrame was called. |
EVENT_MOVE_TO | LAnimationWindow::MoveToFrame was called. |
EVENT_PLAYSTATE_START | LAnimationWindow::PlayAnimation was called and the playback was started. |
EVENT_PLAYSTATE_STOP | LAnimationWindow::StopAnimation was called or the playback reached the end. |
EVENT_PLAYSTATE_PRECLEAR | The initial state of the playback (index = -1). The target bitmap will be cleared to the Bitmap background color on the next call. |
EVENT_PLAYSTATE_POSTCLEAR | The target bitmap has been cleared. |
EVENT_PLAYSTATE_PRERENDER | The current image will be rendered to the target bitmap. |
EVENT_PLAYSTATE_RENDER | An image has been rendered to the target bitmap. |
EVENT_PLAYSTATE_POSTRENDER | An image is in the midst of being rendered to the target bitmap. |
EVENT_PLAYSTATE_WAITINPUT | The playback engine is waiting for user input before moving on to PLAYSTATE_PREDISPOSE. |
EVENT_PLAYSTATE_WAITDELAY | The playback engine is waiting for a delayed time before moving on to PLAYSTATE_PREDISPOSE. |
EVENT_PLAYSTATE_WAITINPUTDELAY | The playback engine is waiting for user input and a delayed time before moving on to PLAYSTATE_PREDISPOSE. |
EVENT_PLAYSTATE_PREDISPOSE | The current image will be disposed of. |
EVENT_PLAYSTATE_POSTDISPOSE | The current image has been disposed of. The index is incremented after processing this state. |
EVENT_PLAYSTATE_LOOP | Animation playback has looped back to the first frame. |
The current frame number being displayed.
None.
This function is called to indicate that an animation event has occurred, or that one of the LAnimationWindow::MoveXXX functions has been called.
You must enable the animation events using LAnimationWindow::EnableAnimateEvent before this function will be called.
Override this function in order to be notified of the events.
The events from EVENT_PLAYSTATE_START to EVENT_POSTDISPOSE are generated by LAnimationWindow::PlayAnimation.
Win32, x64.
class MyClass : public LAnimationWindow
{
public :
virtual L_VOID AnimateEvent(L_INT nEvent,L_INT nFrameNumber)
{
L_TCHAR szStr[255];
wsprintf(szStr,TEXT("Event number : %d\nFrameNumber : %d"),nEvent, nFrameNumber);
MessageBox(m_hWnd, szStr, TEXT("Example"), MB_OK|MB_ICONINFORMATION);
//call base class
LAnimationWindow::AnimateEvent(nEvent, nFrameNumber);
}
};
L_INT LAnnAutomation_LAnimationWindow_AnimateEventExample(HWND hWndParent)
{
L_INT nRet;
LBase::LoadLibraries(LT_ALL_LEADLIB);
//make sure all libraries are loaded
MyClass MyAnimation;
MyAnimation.SetFileName(MAKE_IMAGE_PATH(TEXT("eye.gif")));
nRet = MyAnimation.Load();
if ( nRet==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.EnableAnimateEvent();
nRet = MyAnimation.PlayAnimation();
if(nRet != SUCCESS)
return nRet;
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
else
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