C
china_bill
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.loadpicClick(Sender: TObject);
var
FS:TMemoryStream;
jpg:TJpegImage;
bmp:Tbitmap;
begin
if OpenDialog1.Execute then
begin
try
jpg:=TJpegImage.create;
bmp:=Tbitmap.create;
FS:=TMemoryStream.Create;
jpg.LoadFromFile(OpenDialog1.FileName);
bmp.Assign(jpg);
bmp.SaveToStream(FS);//将图片转换成内存流
image1.Picture.Bitmap.LoadFromStream(FS);//交图片显示出来 但失败了,显示不出来
finally
jpg.free;
bmp.free;
Fs.Free;
end;
end;
end;
var
FS:TMemoryStream;
jpg:TJpegImage;
bmp:Tbitmap;
begin
if OpenDialog1.Execute then
begin
try
jpg:=TJpegImage.create;
bmp:=Tbitmap.create;
FS:=TMemoryStream.Create;
jpg.LoadFromFile(OpenDialog1.FileName);
bmp.Assign(jpg);
bmp.SaveToStream(FS);//将图片转换成内存流
image1.Picture.Bitmap.LoadFromStream(FS);//交图片显示出来 但失败了,显示不出来
finally
jpg.free;
bmp.free;
Fs.Free;
end;
end;
end;