Available in the LEADTOOLS Imaging toolkit. |
AnimationEnable Example for Visual J++
This example loads and plays an animated file. It assumes that the LEAD control has already been sized to the aspect ratio of the image.
// Load all pages of an AVI file.
LEAD1.Load( "c:\\lead\\images\\sample1.avi", (short) 0, (short) 1, (short) -1 );
// Set properties for a scaled animation.
LEAD1.setAutoRepaint( true );
LEAD1.setAutoSetRects( false );
// Set the image display size to match the LEAD control.
LEAD1.SetDstRect( 0, 0, LEAD1.getScaleWidth(), LEAD1.getScaleHeight() );
LEAD1.SetDstClipRect( 0, 0, LEAD1.getScaleWidth(), LEAD1.getScaleHeight() );
// Allow a continuous loop.
LEAD1.setAnimationLoop( true );
// Start the animation.
LEAD1.setAnimationEnable( true );