ShowRotateDlg example for Delphi

procedure TForm1.ShowRotateDlg1Click(Sender: TObject);
var
   nRet: L_INT; 
begin
   LEADDlgImage1.ZoomToFit:= False; 
   LEADDlgImage1.BackgroundColor:= RGB ( 255, 0, 0 ); 
   LEADDlgImage1.LEADImage:= LEADImage1; 
   LEADDlgImage1.DlgFlags:= DLG_ROTATE_AUTOPROCESS Or
                            DLG_ROTATE_SHOW_PREVIEW Or
                             DLG_ROTATE_SHOW_BACKCOLOR Or
                             DLG_ROTATE_SHOW_RESIZE; 

   LEADDlgImage1.LEADDlgService:= LEADDlgService1; 
   LEADDlgImage1.EnableMethodErrors:= False; 
   LEADDlgImage1.ShowHelpButton:= True; 

   nRet:= LEADDlgImage1.ShowRotateDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      {output the results}
      Edit1.Text := IntToStr ( LEADDlgImage1.Angle); 
      if ( LEADDlgImage1.Resize ) then
         Edit2.Text:= 'True'
      else
         Edit2.Text:= 'False'; 

      Case ( LEADDlgImage1.ResizeFlags ) of
         0: 
            ShowMessage('Using Resize normal method'); 

         ROTATE_RESAMPLE: 
            ShowMessage('Using Resize resample method'); 

         ROTATE_BICUBIC: 
             ShowMessage('Using Resize bicubic method'); 
      end; 

   end; 
end; 
procedure TForm1.LEADDlgImage1DlgHelp (uDialogID: Cardinal); 
begin
   case ( uDialogID ) of

      DLG_HELP_ROTATE: 
         ShowMessage( 'Help from Rotate dialog' ); 

      DLG_HELP_SHEAR: 
         ShowMessage( 'Help from Shear dialog' ); 

      DLG_HELP_RESIZE: 
         ShowMessage( 'Help from Resize dialog' ); 

      DLG_HELP_ADDBORDER: 
         ShowMessage( 'Help from Add-Border dialog' ); 

      DLG_HELP_ADDFRAME: 
         ShowMessage( 'Help from Add-Frame dialog' ); 

      DLG_HELP_AUTOTRIM: 
         ShowMessage( 'Help from Auto-Trim dialog' ); 

      DLG_HELP_CANVASRESIZE: 
         ShowMessage( 'Help from Canvas-Resize dialog' ); 

      DLG_HELP_FEATHERSELECTION: 
         ShowMessage( 'Help from Feather-Selection dialog' ); 
   end; 
end;