我在delphi7的窗口中放了一个image控件image1(图片跟程序保存在同一目录下)输入以下代码,运行报错
procedure TForm1.FormCreate(Sender: TObject);
var
PictureFile:string;
begin
image1.Visible:=true;
image1.BringToFront;
PictureFile:=extractfilepath(application.exename)+'2004929205043253.jpg';
image1.Picture.LoadFromFile(PictureFile);
end;end.错误为:
project Project1.exe raised exception class EInvalidGraphic with message'Unkown
picture file extension (.jpg)'. Process stopped. Use step or Run to contiune.
procedure TForm1.FormCreate(Sender: TObject);
var
PictureFile:string;
begin
image1.Visible:=true;
image1.BringToFront;
PictureFile:=extractfilepath(application.exename)+'2004929205043253.jpg';
image1.Picture.LoadFromFile(PictureFile);
end;end.错误为:
project Project1.exe raised exception class EInvalidGraphic with message'Unkown
picture file extension (.jpg)'. Process stopped. Use step or Run to contiune.
{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
var Jpg:TJpegimage;
begin
jpg:=TJpegimage.Create;
jpg.LoadFromFile('C:\Desktop.jpg');
image1.Picture.Assign(jpg);
jpg.Free;
end;