Get Touch Coordinates Relative To A View (ScreenToClient Equivalent?)
<p>I have an image I am displaying to a user in my android application.</p>

<p>I want to be able to tell where they 'touch' the image.</p>

<p>I can easily get the screen coordinates by implementing an OnTouchListener</p>

<pre><code> private OnTouchListener image_Listener = new OnTouchListener(){
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        if(event.getAction() == MotionEvent.ACTION_UP) {
            float x = event.getX();
            float y = event.getY();
            return true;
        }
        return false;
    }
};
</code></pre>

<p>However, these are absolute coordinates.  What I really need is a function to convert this into coordinates relative to a View..</p>

<p>I have done a bit of digging, but I can't seem to turn up anything, aside from me trying to implement a ScreenToClient method myself..</p>

<p>Does anyone know of a good solution to this, or am I just going to have to roll my own?</p>

<p>It seems like the kind of method that would be available - that's why I'm asking.</p>

<p>Thank you all for your time.</p>

<p>EDIT: I'm not so sure that the coordinates aren't already relative to the view.  I could have swore reading that coordinates were absolute, but after some tinkering - I have things working as I expected.. Sorry for the noise guys.</p>
