OnOpenFile example for Delphi
procedure TForm1.ShowOpenDlg3Click(Sender: TObject);
begin
LEADDlgFile1.DialogTitle:= 'LEADTOOLS Open dialog box';
LEADDlgFile1.InitialDir:= 'c:\images';
LEADDlgFile1.DlgFileFlags:= DLG_OPEN_ALLOWMULTI;
LEADDlgFile1.MaxFileSize:= 0;
LEADDlgFile1.MaxFileTitleSize:= 0;
LEADDlgFile1.DlgFlags:= DLG_OPEN_SHOW_PROGRESSIVE +
DLG_OPEN_SHOW_MULTIPAGE +
DLG_OPEN_SHOW_LOADROTATED +
DLG_OPEN_SHOW_LOADCOMPRESSED +
DLG_OPEN_SHOW_FILEINFO +
DLG_OPEN_SHOW_PREVIEW +
DLG_OPEN_SHOW_DELPAGE +
DLG_OPEN_VIEWTOTALPAGES +
DLG_OPEN_LOADBITMAP +
DLG_OPEN_GENERATETHUMBNAIL;
LEADDlgFile1.LEADImage:= LEADImage1;
LEADDlgFile1.ShowOpenDlg ( Self );
end;
Function TForm1.LEADDlgFile1OpenFile ( nFilePercent,
nTotalPercent: Integer ): Integer;
begin
Caption:= LEADDlgFile1.FileName;
if ( nFilePercent = 100 ) then
begin
LEADImage1.Bitmap:= LEADDlgFile1.Bitmap;
LEADImage2.Bitmap:= LEADDlgFile1.Thumbnail;
end;
Result:= SUCCESS;
end;