1

here is the code snippet to get bitmap and i am using Touch Event to get the coordinates

`BitmapDrawable drawable = (BitmapDrawable) view.getDrawable();
                    Bitmap bitmap = drawable.getBitmap();
                    float x=event.getX();
                    float y=event.getY();`

Now i want to know whether these x and y lie in the bitmap region or not i found a condition but its in pseudo code Kindly guide me that how can i find this xOfBitmap and yOfBitmap

    if (x >= xOfYourBitmap && x < (xOfYourBitmap + yourBitmap.getWidth()) 
    && y >= yOfYourBitmap && y < (yOfYourBitmap + yourBitmap.getHeight()))
{
    // if this is true, you've started your click inside your bitmap
}

thanks in advance

  • [recent answer](http://stackoverflow.com/questions/6951887/how-to-get-x-and-y-coordinate-of-bitmap-image-in-image-control) and [another one](http://stackoverflow.com/questions/2447564/detect-touch-on-bitmap) – Hanry Aug 05 '11 at 05:52

0 Answers0