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;
Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号
执行时间: 0.047168016433716 seconds