ShowGetShapeDlg example for Delphi

procedure TForm1.ShowGetShapeDlg1Click(Sender: TObject); 
var
   nRet: L_INT; 
begin
   LEADDlgEffect1.ShapeBackgroundBitmap:= LEADImage2.Bitmap; 
   LEADDlgEffect1.Shape:= EFX_SHAPE_PARALLELOGRAM_R; 
   LEADDlgEffect1.BackColor:= RGB ( 0, 0, 255 ); 
   LEADDlgEffect1.ForeColor:= RGB ( 255, 0, 0 ); 
   LEADDlgEffect1.ShapeBackgroundStyle:= sbsOpaque; 
   LEADDlgEffect1.PatternStyle:= epsTransparent; 
   LEADDlgEffect1.ShapeBorderColor:= RGB ( 100, 255, 100 ); 
   LEADDlgEffect1.ShapeBorderStyle:= sbrSolid; 
   LEADDlgEffect1.ShapeBorderThickness:= 5; 
   LEADDlgEffect1.ShapeInnerBandHiliteColor:= RGB ( 255, 255, 255 ); 
   LEADDlgEffect1.ShapeInnerBandShadowColor:= RGB ( 0, 0, 0 ); 
   LEADDlgEffect1.ShapeInnerBandStyle:= sibInset; 
   LEADDlgEffect1.ShapeInnerBandThickness:= 3; 
   LEADDlgEffect1.ShapeOuterBandHiliteColor:= RGB ( 255, 255, 0 ); 
   LEADDlgEffect1.ShapeOuterBandShadowColor:= RGB ( 255, 0, 255 ); 
   LEADDlgEffect1.ShapeOuterBandStyle:= sobInset; 
   LEADDlgEffect1.ShapeOuterBandThickness:= 5; 
   LEADDlgEffect1.ShadowXDepth:= 10; 
   LEADDlgEffect1.ShadowYDepth:= 10; 
   LEADDlgEffect1.ShadowColor:= RGB ( 128, 128, 128 ); 
   LEADDlgEffect1.DlgFlags:= DLG_SHAPE_SHOW_PREVIEW         Or
                         DLG_SHAPE_AUTOPREVIEW          Or
                         DLG_SHAPE_BACKSTYLE            Or
                         DLG_SHAPE_FILLSTYLE            Or
                         DLG_SHAPE_FORE_BACK_COLOR      Or
                         DLG_SHAPE_BORDERSTYLE          Or
                         DLG_SHAPE_BORDERWIDTH          Or
                         DLG_SHAPE_BORDERCOLOR          Or
                         DLG_SHAPE_INNERSTYLE           Or
                         DLG_SHAPE_INNERWIDTH           Or
                         DLG_SHAPE_INNER_HILITE_SHADOW  Or
                         DLG_SHAPE_OUTERSTYLE           Or
                         DLG_SHAPE_OUTERWIDTH           Or
                         DLG_SHAPE_OUTER_HILITE_SHADOW  Or
                         DLG_SHAPE_SHADOWCOLOR          Or
                         DLG_SHAPE_SHADOW_X_Y           Or
                         DLG_SHAPE_BROWSEIMAGE          Or
                         DLG_SHAPE_CLASS_SQUARE         Or
                         DLG_SHAPE_CLASS_RECTANGLE      Or
                         DLG_SHAPE_CLASS_PARALLELOGRAM  Or
                         DLG_SHAPE_CLASS_TRAPEZOID      Or
                         DLG_SHAPE_CLASS_TRIANGLE       Or
                         DLG_SHAPE_CLASS_OTHER          Or
                         DLG_SHAPE_CLASS_CIRCLE         Or
                         DLG_SHAPE_CLASS_ELLIPSE        Or
                         DLG_SHAPE_CLASS_STAR           Or
                         DLG_SHAPE_CLASS_CROSS          Or
                         DLG_SHAPE_CLASS_ARROW; 

   LEADDlgEffect1.LEADImage:= LEADImage1; 
   LEADDlgEffect1.LEADDlgService:= LEADDlgService1; 
   LEADDlgEffect1.EnableMethodErrors:= False; 
   LEADDlgEffect1.ShowHelpButton:= True; 

   nRet:= LEADDlgEffect1.ShowGetShapeDlg ( Self ); 

   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.ShapeLeft:= 50; 
      LEADImage1.ShapeTop:= 50; 
      LEADImage1.ShapeWidth:= LEADImage1.DstWidth - 50; 
      LEADImage1.ShapeHeight:= LEADImage1.DstHeight - 50; 
      LEADImage1.PatternBackColor:= LEADImage1.BackColor; 
      LEADImage1.BackgroundImageLeft:= 0; 
      LEADImage1.BackgroundImageTop:= 0; 
      LEADImage1.BackgroundImageWidth:= LEADImage2.BitmapWidth; 
      LEADImage1.BackgroundImageHeight:= LEADImage2.BitmapHeight; 
      LEADImage1.ShapeBackgroundStyle:= LEADImage1.ShapeBackgroundStyle; 
      LEADImage1.PatternForeColor:= LEADImage1.PatternForeColor; 
      LEADImage1.PatternStyle:= LEADImage1.PatternStyle; 
      LEADImage1.ShapeBorderColor:= LEADImage1.ShapeBorderColor; 
      LEADImage1.ShapeBorderStyle:= LEADImage1.ShapeBorderStyle; 
      LEADImage1.ShapeBorderThickness:= LEADImage1.ShapeBorderThickness; 
      LEADImage1.ShapeInnerBandHiliteColor:= LEADImage1.ShapeInnerBandHiliteColor; 
      LEADImage1.ShapeInnerBandShadowColor:= LEADImage1.ShapeInnerBandShadowColor; 
      LEADImage1.ShapeInnerBandStyle:= LEADImage1.ShapeInnerBandStyle; 
      LEADImage1.ShapeInnerBandThickness:= LEADImage1.ShapeInnerBandThickness; 
      LEADImage1.ShapeOuterBandHiliteColor:= LEADImage1.ShapeOuterBandHiliteColor; 
      LEADImage1.ShapeOuterBandShadowColor:= LEADImage1.ShapeOuterBandShadowColor; 
      LEADImage1.ShapeOuterBandStyle:= LEADImage1.ShapeOuterBandStyle; 
      LEADImage1.ShapeOuterBandThickness:= LEADImage1.ShapeOuterBandThickness; 
      LEADImage1.ShadowXDepth:= LEADImage1.ShadowXDepth; 
      LEADImage1.ShadowYDepth:= LEADImage1.ShadowYDepth; 
      LEADImage1.ShadowColor:= LEADImage1.ShadowColor; 

      LEADImage1.DrawShape (LEADDlgEffect1.Shape, LEADImage2.Bitmap ); 
      LEADImage1.ForceRepaint ( ); 
   end; 
end; 
procedure TForm1.LEADDlgEffect1DlgHelp (uDialogID: Cardinal); 
begin
   case ( uDialogID ) of

      DLG_HELP_GETEFFECT: 
         ShowMessage( 'Help from GetEffect dialog' ); 

      DLG_HELP_GETSHAPE: 
         ShowMessage( 'Help from GetShape dialog' ); 

      DLG_HELP_GETTEXT: 
         ShowMessage( 'Help from GetText dialog' ); 

      DLG_HELP_GETGRADIENT: 
         ShowMessage( 'Help from GetGradient dialog' ); 

      DLG_HELP_GETTRANSITION: 
         ShowMessage( 'Help from GetTransition dialog' ); 
   end; 
end;