M
M
mississippi2018-02-13 13:36:21
C++ / C#
mississippi, 2018-02-13 13:36:21

How to add mouse click event on image?

I have a drawing that I draw myself (let's say it's a square). What are the ways to make it so that when you click on this picture, some action would occur?
PS I think it's possible to use SkiaSharp, but I can't figure out how.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bashinsky, 2018-02-13
@BashkaMen

Depending on what this square is, if it's just something drawn on the canvas, then I will offer such a variak.
You catch the click event on the canvas, there are coordinates in the parameters where you clicked, and since you know the size and position of your shape, you can determine whether there was a click on the shape or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question