PaintEffectMaxPasses example for Delphi

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.

var
   RasterIO: LEADRasterIO;
begin
   RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
   LEADRasterView1.AutoRepaint:= False;
   LEADRasterView1.PaintEffect:= EFX_EFFECT_WIPE_RECTANGLE_IN; //Set the Effect
   LEADRasterView1.PaintEffectMaxPasses:= 5;                   //5 total passes
   LEADRasterView1.PaintEffectPass:= 1;                        //Start with pass number 1
   LEADRasterView1.PaintNotificationDelay:= 200;         //Delay 200 milliseconds between passes
   RasterIO.Load (LEADRasterView1.Raster, 'v:\images\240bit.bmp', 0, 0, 1);//Load the image
   LEADRasterView1.AutoRepaint:= True;
end;

procedure TForm1.LEADRasterView1PaintNotification (Sender: TObject; uPass,
  uType: Smallint);
begin
  //If the first pass is complete
  if ((uType = EFX_NOTIFY_IMAGE) And (uPass > 0)) then
  begin
      //Toggle the effect from left_to_right to right_to_left
      if LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN then
          LEADRasterView1.PaintEffect:= EFX_EFFECT_WIPE_RECTANGLE_OUT
      else
          LEADRasterView1.PaintEffect:= EFX_EFFECT_WIPE_RECTANGLE_IN
  end;
end;