Page 1 of 1

Screenshot of element

Posted: Mon Dec 06, 2021 11:22 am
by WJC
Hello.

How can I do to get the screenshot of an element, DIV, BUTTON, INPUT, etc. and then use that image in my delphi application?

Which is the best or easiest way to do it? Using javascript? Using OSR Chrome?

Thanks

Re: Screenshot of element

Posted: Mon Dec 06, 2021 2:45 pm
by salvadordf
Hi,

You can use the demo you like most because you can take screenshots in normal mode or OSR mode.

If you just want to take the screenshot of one element then you would need to crop the screenshot of the whole web browser using the element coordinates and size.

In order to get the element coordinates and size I would recommend using JavaScript and then send the coordinates and size back to the browser using the "console trick" that you have on the DOMVisitor demo.