PaintTransitionMaxPasses example for C++ Builder

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

   LEADRasterIO* pRasterIO= NULL;

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

   LEADRasterView1->AutoRepaint = False;
     LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN; //Set the Effect
     LEADRasterView1->EffectDelay = 100;
     LEADRasterView1->PaintTransitionMaxPasses = 5; //5 total passes
     LEADRasterView1->PaintTransitionPass = 1;      //Start with pass number 1
     LEADRasterView1->PaintNotificationDelay = 200 ;//Delay 200 milliseconds between passes
     pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\240bit.bmp"), 0, 0, 1 );//Load the image
     LEADRasterView1->AutoRepaint = True;

   pRasterIO-> Release( );
void __fastcall TForm1::LEADRasterView1PaintNotification(TObject *Sender,
      short uPass, short uType)
{
  //If the first pass is complete
  if ((uType == EFX_NOTIFY_IMAGE) && (uPass > 0))
  {
      //Toggle the effect from left_to_right to right_to_left
      if (LEADRasterView1->TransitionEffect == EFX_EFFECT_WIPE_RECTANGLE_IN)
          LEADRasterView1->TransitionEffect= EFX_EFFECT_WIPE_RECTANGLE_OUT;
      else
          LEADRasterView1->TransitionEffect= EFX_EFFECT_WIPE_RECTANGLE_IN;
  }
}