本文整理自网络,侵删。
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 移动windows开始按钮到任务栏中的任何位置
Delphi xe5 for android 调用java类库必看的文件
更多相关阅读请进入《Delphi》频道 >>