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.
getBoundingClientRect() to screen coodinate
getBoundingClientRect() to screen coodinate
If it is possible to translate a value of element.getBoundingClientRect() in JS to a coodinate in sendmessage() in delphi ? T hank you!
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: getBoundingClientRect() to screen coodinate
Read this thread :
https://www.briskbard.com/forum/viewtopic.php?p=9792#p9792
It has information for WebView4Delphi but it shows how to sent the element coordinates.
Use a JS extension to send the coordinates to Delphi :
https://github.com/salvadordf/CEF4Delphi/blob/373a19f8f512974d9c0c15b58fd5a5e009d3c24a/demos/Delphi_VCL/JavaScript/JSExtension/uJSExtension.pas#L85
https://www.briskbard.com/forum/viewtopic.php?p=9792#p9792
It has information for WebView4Delphi but it shows how to sent the element coordinates.
Use a JS extension to send the coordinates to Delphi :
https://github.com/salvadordf/CEF4Delphi/blob/373a19f8f512974d9c0c15b58fd5a5e009d3c24a/demos/Delphi_VCL/JavaScript/JSExtension/uJSExtension.pas#L85
Re: getBoundingClientRect() to screen coodinate
sorry, I cannot find how to get correct coodinate in that web.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: getBoundingClientRect() to screen coodinate
The JSExtension demo uses a JavaScript extension with two methods : mouseover, sendresulttobrowser.
Copy that code and use "sendresulttobrowser" to send custom information from JavaScript to Delphi.
Copy that code and use "sendresulttobrowser" to send custom information from JavaScript to Delphi.