Available in the LEADTOOLS Imaging toolkit. |
AnimationPause Example for C++ 4.0 and later
void CAnimationDlg::OnEnableanimation()
{
/* Load all pages of an animated gif file.*/
m_LEAD1.Load ( "E:\\LEADTOOLS\\Images\\eye.gif", 0, 1, -1 ) ;
// Set properties for a scaled animation.
m_LEAD1.SetAutoRepaint (TRUE);
m_LEAD1.SetAutoSetRects (FALSE);
// Set the image display size to match the LEAD control.
m_LEAD1.SetDstRect (0.0f, 0.0f, m_LEAD1.GetScaleWidth(), m_LEAD1.GetScaleHeight());
m_LEAD1.SetDstClipRect (0.0f, 0.0f, m_LEAD1.GetScaleWidth(), m_LEAD1.GetScaleHeight());
// Allow a continuous loop.
m_LEAD1.SetAnimationLoop (TRUE);
// Start the animation.
m_LEAD1.SetAnimationEnable (TRUE);
/*Set the middle frame as the start frame in the animation*/
m_LEAD1.SetAnimationFrameIndex ((int)(m_LEAD1.GetBitmapListCount / 2) - 1);
}
void CAnimationDlg::OnTogglePause()
{
m_LEAD1.SetAnimationPause (! m_LEAD1.GetAnimationPause () );
}