试过大家讲的方法:uses jpeg;
但还是没办法打开文件
看了OpenpictureDialog的filter属性默认的只有.bmp .ico .emf...没有.jpg
自己把filter属性加上.jpg,运行程序之后还是不能把.jpg的文件显示出来
大家帮帮忙,小弟先谢谢了
但还是没办法打开文件
看了OpenpictureDialog的filter属性默认的只有.bmp .ico .emf...没有.jpg
自己把filter属性加上.jpg,运行程序之后还是不能把.jpg的文件显示出来
大家帮帮忙,小弟先谢谢了
var
a:tjpeg;
begin
a:=tjpeg.create;
a.loadfile('')
end;
D7 的 TOpenPictureDialog 的 Filter 属性里本来就有 jpg 和 jpeg 的。
有没有打补丁,打补丁看看。
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Jpeg, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
AJpg:TJpegImage;
AOpenDlg:TOpenDialog;
begin
AOpenDlg:=TOpenDialog.Create(self);
if AOpenDlg.Execute then
begin
AJpg:=TJpegImage.Create;
AJpg.LoadFromFile(AOpenDlg.FileName);
self.Image1.Picture.LoadFromFile(AOpenDlg.FileName);
AJpg.Free;
end;end;end.
AJpg可做他用!