ShowAddBorderDlg example for Delphi

procedure TForm1.ShowAddBorderDlg1Click(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_ADDBORDER_SHOW_PREVIEW Or
                             DLG_ADDBORDER_SHOW_TOOL_ZOOMLEVEL Or
                             DLG_ADDBORDER_SHOW_TOOL_SHOWEFFECT Or
                             DLG_ADDBORDER_SHOW_TOOL_ONSCREEN Or
                             DLG_ADDBORDER_SHOW_TOOL_RESET; 
   LEADDlgImage1.LEADImage:= LEADImage1; 
   nRet:= LEADDlgImage1.ShowAddBorderDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.AddBorder ( LEADDlgImage1.LeftThickness
                             LEADDlgImage1.TopThickness
                             LEADDlgImage1.RightThickness
                             LEADDlgImage1.BottomThickness
                             LEADDlgImage1.Location
                             LEADDlgImage1.BorderStyle
                             LEADDlgImage1.EffectStyle
                             LEADDlgImage1.SelectedBitmap
                             LEADDlgImage1.GradientStyle
                             LEADDlgImage1.GradientStartColor
                             LEADDlgImage1.GradientEndColor
                             LEADDlgImage1.CurveIntensity
                             LEADDlgImage1.SoftCurve
                             LEADDlgImage1.UseShadow
                             LEADDlgImage1.ShadowSize
                             LEADDlgImage1.ShadowDirection
                             LEADDlgImage1.BumpyShadow ); 
   end; 
end;