Skip to content

Instantly share code, notes, and snippets.

@melice
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melice/47d0e114dc27baa96de7 to your computer and use it in GitHub Desktop.
Save melice/47d0e114dc27baa96de7 to your computer and use it in GitHub Desktop.
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment