ShowUnderlayDlg example for Delphi

procedure TForm1.ShowUnderlayDlg1Click(Sender: TObject); 
var
   i: L_INT; 
   nRet: L_INT; 
   FileNames: Array [ 0..2 ] of String; 
begin
   LEADDlgImgEffect1.ItemsCount:= 3; 
   FileNames[0]:= 'e:\image1.jpg'; 
   FileNames[1]:= 'e:\image2.jpg'; 
   FileNames[2]:= 'e:\image3.jpg'; 

   for i:= 0 to 2 do
   begin
      LEADImage2.LoadStamp ( FileNames[i] ); 
      LEADDlgImgEffect1.ItemDescription [i]:= IntToStr(i); 
      LEADDlgImgEffect1.ItemFileName [i]:= FileNames[i]; 
      LEADDlgImgEffect1.ItemBitmap [i]:= LEADImage2.Bitmap; 
   end; 
   LEADDlgImgEffect1.SelectedBitmapIndex:= 0; 
   LEADDlgImgEffect1.UnderlayFlags:= UB_TILE; 
   LEADDlgImgEffect1.DlgFlags:= DLG_UNDERLAY_SHOW_PREVIEW Or
                      DLG_UNDERLAY_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgImgEffect1.LEADImage:= LEADImage1; 
   nRet:= LEADDlgImgEffect1.ShowUnderlayDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.Underlay ( LEADDlgImgEffect1.SelectedBitmap
                    LEADDlgImgEffect1.UnderlayFlags ); 
   end; 
end;