+ -
当前位置:首页 → 问答吧 → delphi 获取网络上的图片

delphi 获取网络上的图片

时间:2011-09-02

来源:互联网

比如说直接获取http://www.fjwater.gov.cn/fangxun_fj/index.jsp这个页面上的数据,然后显示到delphi上去, 这要怎么做啊?要用什么控件 啊,,我只知道用idhttp呢!

作者: zhongqian1_6   发布时间: 2011-09-02

pic是图片的id
Delphi(Pascal) code

var
  i:Integer;
  rang:IHTMLControlRange;
  s:string;
begin
  try
  s := (IHTMLDocument2(wb.Document).images.item('pic',EmptyParam) as IHTMLElement).getAttribute('src',0);
  //showmessage(s);
      rang:=((IHTMLDocument2(wb.Document).body as HTMLBody).createControlRange)as
        IHTMLControlRange;
      rang.add(IHTMLDocument2(wb.Document).images.item('pic',EmptyParam)as
        IHTMLControlElement);
      rang.execCommand('Copy',False,0);
      image1.Picture.Assign(ClipBoard);
  except
  end;
end;

作者: bdmh   发布时间: 2011-09-02

分析页面,得到里面的img的src,再取此src到流或临时文件,再显示此内容

作者: sz_haitao   发布时间: 2011-09-02

热门下载

更多