ShowAddFrameDlg example for Delphi

procedure TForm1.ShowAddFrameDlg2Click(Sender: TObject); 
var
   i: L_INT; 
   nRet: L_INT; 
   FileNames: Array [ 0..2 ] of String; 
begin
   LEADDlgImage1.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] ); 
      LEADDlgImage1.ItemDescription [i]:= IntToStr(i); 
      LEADDlgImage1.ItemFileName [i]:= FileNames[i]; 
      LEADDlgImage1.ItemBitmap [i]:= LEADimage2.Bitmap; 
   end; 

   LEADDlgImage1.BitmapIndex:= 1; 

   LEADDlgImage1.DlgFlags:= DLG_ADDFRAME_AUTOPROCESS Or
                             DLG_ADDFRAME_SHOW_PREVIEW Or
                             DLG_ADDFRAME_SHOW_TOOL_ZOOMLEVEL Or
                             DLG_ADDFRAME_SHOW_TOOL_SHOWEFFECT Or
                             DLG_ADDFRAME_SHOW_TOOL_ONSCREEN Or
                             DLG_ADDFRAME_SHOW_TOOL_RESET; 

   LEADDlgImage1.LEADImage:= LEADImage1; 
   nRet:= LEADDlgImage1.ShowAddFrameDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.AddFrame ( LEADDlgImage1.SelectedBitmap
                            LEADDlgImage1.KeepFrameState
                            LEADDlgImage1.UseMask
                            LEADDlgImage1.MaskColor
                            LEADDlgImage1.SmoothEdge
                            LEADDlgImage1.Location
                            LEADDlgImage1.Quality ); 
   end; 
end;