AnimationEnable Example for C++ 5.0 and later
This example loads and plays an animated file. It assumes that the LEAD RasterViewcontrol has already been sized to the aspect ratio of the image.
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// Load all pages of a GIF file.
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"d:\\lead14\\dist\\images\\eye.gif",
0, 1, -1);
pRasterIO->Release();
// Set properties for a scaled animation.
m_LEADRasterView1.SetAutoRepaint(TRUE);
m_LEADRasterView1.SetAutoSetRects(FALSE);
// Set the image display size to match the LEAD control.
m_LEADRasterView1.SetDstRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f, m_LEADRasterView1.GetScaleWidth(), m_LEADRasterView1.GetScaleHeight());
// Allow a continuous loop.
m_LEADRasterView1.SetAnimationLoop(TRUE);
// Start the animation.
m_LEADRasterView1.SetAnimationEnable(TRUE);