AnimationEnable Example for Visual Basic

Note: Also works with Access 95 and 97.

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.

Dim RasterIO As New LEADRasterIO
' Load all pages of a GIF file.
RasterIO.Load LEADRasterView1.Raster, "d:\lead14\dist\images\eye.gif", 0, 1, -1
' Set properties for a scaled animation.
LEADRasterView1.AutoRepaint = True
LEADRasterView1.AutoSetRects = False
' Set the image display size to match the LEAD control.
LEADRasterView1.SetDstRect 0, 0, _
                LEADRasterView1.ScaleWidth, _
                LEADRasterView1.ScaleHeight
LEADRasterView1.SetDstClipRect 0, 0, _
                LEADRasterView1.ScaleWidth, _
                LEADRasterView1.ScaleHeight
' Allow a continuous loop.
LEADRasterView1.AnimationLoop = True
' Start the animation.
LEADRasterView1.AnimationEnable = True