math - How to find touch point angle in arc android -


I want to create an image below using canvas Android, here I want to know that the user inside the touch point arch (I.e. wx1, wx2 .. wx7). I'm not sure about finding angles for user touch. Please provide me some suggestions.

Here is the code for drawing the arc, the broom angle varies depending on the position

 for  (int i = 0; i <360; = (I + 20)) (If (i <200 || i> = 340) {canvas.drawArc (rect, i, (float) 20.2, wrong, dark gray);} Else {canvas.drawArc (Rect, i, (float) 19, wrong, light gray)}}  

here is the image

< Div class = "post-text" itemprop = "text">

the way. So, you will create rectangular dimensions that are related by each hand, which are related to each of your visual elements.

onTouch

P

On Touch Listener

Attach will be:

  @override public boolean on touch (see We, Motion Event Event) {Log D. ("Bounds", "X:" + Event .getX (+) "y:" + Event.getY ()); If (rect1.contains (int) event.getX (), (int) event.getY ()) {....} and if (rect2.contains ((int) event.getX (), (int) event. GetY ())) {....} return false; }  

Take a look at the following references:


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -