本文整理自网络,侵删。
uses
jpeg;function TForm1.GetImage(url: string): boolean;
var
MemoryStream:TMemoryStream;
Idhttp:TIdhttp;
Img: TJPEGImage;
begin
MemoryStream:=TMemoryStream.Create ;
Idhttp:=Tidhttp.Create(nil);
Img := TJPEGImage.Create;
try
Idhttp.Get(url,MemoryStream);
MemoryStream.Position := 0;
Img.LoadFromStream(MemoryStream);
Image1.Picture.Bitmap.Assign(Img);
finally
MemoryStream.Free ;
Idhttp.Free;
Img.Free;
end;
end;
相关阅读 >>
Delphi xe8 numberbox使用方法及存在的问题
Delphi generics collections tdictionary 用法
Delphi 2009 之 tstringbuilder 类[1]: create
Delphi 用 directshow 获取本机的视频摄像设备列表
Delphi windows 编程[9] - wm_close 消息
更多相关阅读请进入《Delphi》频道 >>