本文整理自网络,侵删。
procedure TfrmMain.DomImg2Image(wb:TWebBrowser);var i:Integer; rang:IHTMLControlRange; s:string;begin try s := (IHTMLDocument2(wb.Document).images.item('pic',EmptyParam) as IHTMLElement).getAttribute('src',0); 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;
相关阅读 >>
Delphi xe5 android 使用system.zip单元释放资源文件
Delphi xe 安卓web开发 错误:net::err_cleartext_not_permitted
Delphi 读取流 image1 stream 加载到image2 timage 对象
更多相关阅读请进入《Delphi》频道 >>