ShowResizeDlg example for C++ Builder

void __fastcall TForm1::ShowResizeDlg1Click(TObject *Sender) 
{
   L_INT nRet; 
   AnsiString strCaption; 

   LEADDlgImage1->MaxNewWidth = 0; 
   LEADDlgImage1->MaxNewHeight = 0; 
   LEADDlgImage1->MaxNewResolutionX = 0; 
   LEADDlgImage1->MaxNewResolutionY = 0; 
   LEADDlgImage1->OriginalWidth = LEADImage1->BitmapWidth; 
   LEADDlgImage1->OriginalHeight = LEADImage1->BitmapHeight; 
   LEADDlgImage1->OriginalResolutionX = LEADImage1->BitmapXRes; 
   LEADDlgImage1->OriginalResolutionY = LEADImage1->BitmapYRes; 
   LEADDlgImage1->OriginalBitsPerPixel = LEADImage1->BitmapBits; 

   LEADDlgImage1->DlgFlags = DLG_RESIZE_SHOW_IDENTICALVALUE |
                            DLG_RESIZE_SHOW_MAINTAINASPECT |
                            DLG_RESIZE_SHOW_PERCENTAGE     |
                            DLG_RESIZE_AUTOPROCESS          |
                            DLG_RESIZE_SHOW_RESOLUTIONGRP; 

   LEADDlgImage1->LEADImage = LEADImage1; 
   LEADDlgImage1->LEADDlgService = LEADDlgService1; 
   strCaption= LEADDlgService1->GetDialogString ( DLG_RESIZE_IDSTR_CAPTION ); 
   ShowMessage ( "Old Caption: " + strCaption ); 

   /*set some custom strings*/
   LEADDlgService1->SetDialogString ( DLG_RESIZE_IDSTR_CAPTION, "My Custom Caption" ); 
   /*set a custom font, note, you should use a font on your system*/
   LEADDlgService1->DialogsFont->Name= "Bones";
   LEADDlgService1->DialogsFont->Size= 9; 

   nRet= LEADDlgImage1->ShowResizeDlg ( this ); 
   if ( nRet == SUCCESS_DLG_OK ) 
   {
      Edit1->Text= IntToStr(LEADDlgImage1->NewWidth); 
      Edit2->Text= IntToStr(LEADDlgImage1->NewHeight); 
      Edit3->Text= IntToStr(LEADDlgImage1->NewResolutionX); 
      Edit4->Text= IntToStr(LEADDlgImage1->NewResolutionY); 

      switch ( LEADDlgImage1->ResizeFlags ) 
      {
         case SIZE_NORMAL: 
            Edit5->Text= "Normal";
         break; 

         case SIZE_FAVORBLACK: 
            Edit5->Text= "FAVORBLACK";
         break; 

         case SIZE_RESAMPLE: 
            Edit5->Text= "RESAMPLE";
         break; 

         case SIZE_BICUBIC: 
            Edit5->Text= "BICUBIC";
         break; 
      }
   }
}