OnBitmapDataPathClosed example for Delphi

var
gBtmpClosed: Boolean; // Global Variable

procedure TForm1.LEADImage1BitmapDataPathClosed;
begin
   gBtmpClosed:= False;
   ShowMessage ( 'Closed' ) ;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
    gBtmpClosed:= True;
    LEADImage1.BitmapDataPath:= 'http://www.leadtools.com/Home2/vertmkts/images/v13web.jpg';
    while ( gBtmpClosed ) do
      Application.ProcessMessages ( ) ;

    LEADImage1.BitmapDataPath:= 'http://www.leadtools.com/images/end-user.jpg';
end;