每个人都希望每天都是开心的,不要因为一些琐事扰乱了心情还,闲暇的时间怎么打发,关注图老师可以让你学习更多的好东西,下面为大家推荐使用TImage浏览与保存网络图像,赶紧看过来吧!
【 tulaoshi.com - 编程语言 】
网络ID:wnhoo or sos_admin
网名:e梦缘
Mail:wnhoo@163.com
风花雪月 e梦情缘
将http://delphi.ktop.com.tw/delphi.gif直接显示在timage中!
保存为文件,然后显示:
uses UrlMon ;
function DownLoadInternetFile(Source, Dest : String) : Boolean;
begin
try
Result := URLDownloadToFile(nil,PChar(Source),PChar(Dest),0,nil) = 0
except
Result := False;
end;
end;
保存为Tsream,然后显示:
procedure TForm1.Button1Click(Sender: TObject);
var
tm: TMemoryStream;
begin
try
tm := TMemoryStream.Create;
IdHTTP1.Get('http://delphi.ktop.com.tw/delphi.gif', tm);
ShowMessage('OK');
finally
tm.Free;
end;
end;
来源:http://www.tulaoshi.com/n/20160219/1602100.html
看过《使用TImage浏览与保存网络图像》的人还看了以下文章 更多>>