c# - How to use an event to change ellipse size? -


this question has answer here:

i have following problem:

i'm drawing 2 ellipses on ui. see link: http://s14.postimg.org/6sajsb5tp/ellipse.png

i'm able change size clicking on blue line, can change size when mouse on line, otherwise cannot.

my question is:

how can set tolerance, mean .. there event can use set amount of pixels, lets 20 pixel, know when mouse close blue line?

i did mathematically on every mousemove event, wonder if .. there better way? :)

thanks.

[edit1]

i tested @j... approach takes 20 ms give answer if mouse close line or not, find slow i'll keep approach, on every canvas event mouseleftbuttondown check mouse position in relation center ellipse coordinates. takes 0.05 ms check.

thanks helping guys.

i think better way drop elispse in container , attach event handler container.


Comments