Delphi idhttp中get 图像链接通过memorystream加载 image控件显示


本文整理自网络,侵删。

 uses
  jpeg;function TForm1.GetImage(url: string): boolean;
var
  MemoryStream:TMemoryStream;
  Idhttp:TIdhttp;
  ImgTJPEGImage;
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 ado的事务处理例子

Delphi xe8 numberbox使用方法及存在的问题

Delphi generics collections tdictionary 用法

Delphi自动适应屏幕分辨率的属性

Delphi 根据关键字取关键词以后的字符串

Delphi 制作一个内网传播的程序

Delphi 打开android应用信息

Delphi 2009 之 tstringbuilder 类[1]: create

Delphi 用 directshow 获取本机的视频摄像设备列表

Delphi windows 编程[9] - wm_close 消息

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...