Getting image coordinates for a click #1706
-
I'm working on affine and warp transforms in Image and it would be great to be able to get detect button events that resolve to image coordinates. Is there a path to be able to make that happen? The closer the requirement is to the UX the less competent I become (but will to put the effort in) so excuse me if its a stupid ask. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey Kip! So you are looking for something like a click event on an image with the mouse metadata? There isn't a built-in way do this with kino/livebook, but technically you should be able to build a custom component using |
Beta Was this translation helpful? Give feedback.
-
@jonatanklosko you are spot on, that's exactly it. Custom component it will be. I need to bridge that learning gap sometime so may as well be now. Thanks for the pointer. |
Beta Was this translation helpful? Give feedback.
Hey Kip! So you are looking for something like a click event on an image with the mouse metadata? There isn't a built-in way do this with kino/livebook, but technically you should be able to build a custom component using
Kino.JS.Live
where you render an image, then capture any events, or even allow for more complex interactions like region selection, etc. One thing to be careful with is the actual coordinates, we would either need to render the full-sized image with possible scrolls, or adjust the coordinates in case the image is scale to fit the page.