delphi下载网络图片
的有关信息介绍如下:用delphi如何下载网络图片
首先下载到内存流
然后显示
添加一个空间image ,一个idhttp,一个button控件即可
双击Button
写上代码
const
sURL='此处jpg地址';
var
jpg:TJPEGImage;
sm:TMemoryStream;
begin
try
sm:=TMemoryStream.Create;
jpg:=TJPEGImage.Create;
idhtp1.Get(sURL,sm);
sm.Position:=0;
jpg.LoadFromStream(sm);
img1.Picture.Assign(jpg);
except
jpg.Free;
sm.Free;
Exit;
end;
点击下载