Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Screenshot of element

Post Reply
WJC
Posts: 1
Joined: Mon Dec 06, 2021 11:19 am

Screenshot of element

Post 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
User avatar
salvadordf
Posts: 4580
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Screenshot of element

Post 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.
Post Reply