ShowResizeDlg example for Delphi
procedure TForm1.ShowResizeDlg1Click(Sender: TObject);
var
nRet: L_INT;
strCaption: String;
begin
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 Or
DLG_RESIZE_SHOW_MAINTAINASPECT Or
DLG_RESIZE_SHOW_PERCENTAGE Or
DLG_RESIZE_AUTOPROCESS Or
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 ( Self );
if ( nRet = SUCCESS_DLG_OK ) then
begin
Edit1.Text:= IntToStr(LEADDlgImage1.NewWidth);
Edit2.Text:= IntToStr(LEADDlgImage1.NewHeight);
Edit3.Text:= IntToStr(LEADDlgImage1.NewResolutionX);
Edit4.Text:= IntToStr(LEADDlgImage1.NewResolutionY);
Case ( LEADDlgImage1.ResizeFlags ) of
SIZE_NORMAL:
Edit5.Text:= 'Normal';
SIZE_FAVORBLACK:
Edit5.Text:= 'FAVORBLACK';
SIZE_RESAMPLE:
Edit5.Text:= 'RESAMPLE';
SIZE_BICUBIC:
Edit5.Text:= 'BICUBIC';
end;
end;
end;