AnimationEnable Example for C++ Builder

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.

   LEADRasterIO * pRasterIO;

   CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

   //Load all pages of a GIF file.
   pRasterIO->Load ( LEADRasterView1->Raster, AnsiToOLESTR("d:\\pictures\\eye.gif"), 0, 1, -1 ) ;

   pRasterIO-> Release ( );
   //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;