procedure TfMain.muOpenFileClick(Sender: TObject);
var
OpenDlg: TOpenDialog;
strFileName: string;
begin
OpenDlg := TOpenDialog.Create(nil);
try
OpenDlg.InitialDir:=picdir;
OpenDlg.Filter := 'BMP文件(*.bmp)|*.bmp';
OpenDlg.DefaultExt := '*.bmp';
if OpenDlg.Execute then
begin
strFileName := Trim(OpenDlg.FileName);
if strFileName <> '' then
begin
mFileName := strFileName;
image1.Picture.LoadFromFile(mFilename);
stb1.Panels[1].Text:='文件名:'+extractfilename(mFilename);
stb1.Panels[0].Text:='图片大小:'+inttostr(image1.Picture.Width)+','+inttostr(image1.Picture.Height);
end;
end;
finally
FreeAndNil(OpenDlg);
end;
end;