0

I have a modified ImageView View that has as a parameter a BitMap. I want to get the x,y coordinates from the Bitmap when the “onTouch” from the ImageView View is fired in order to plot a point. So far I am able to get the x,y coordinates from the ImageView View and draw a point. The problem is that when I move or resize the image the drawn points wont reference the same position on the BitMap.
Does anyone know how to get the x, y coordinates from a bitmap inside a ImageView View?
Note 1: the original size of the image is bigger than the resolution of the screen

initial dots [resized image resized an moved

xuandl
  • 183
  • 1
  • 2
  • 14
  • 2
    you should probably see [this](http://stackoverflow.com/questions/4933612/how-to-convert-coordinates-of-the-image-view-to-the-coordinates-of-the-bitmap). – adityajones Sep 17 '13 at 20:57
  • I tried to use the question that you point out, but that didn't work. I am using a class that inherits from View and implements onTouchListener. I define a bitmap atribute and that is the image that I drawn in the onDraw(). I use Matrix in order to zoom in or zoom out and move the image arround -canvas.drawBitmap(bitmap, matrix, paint)-. My problem is that I can't get the scaledHeight and scaledWidth. I queep a value that represent the scaled size, so i tried to do something like: x=ldm.getX()*scale; y=ldm.getY()*scale; ldm.setX(x); ldm.setY(y); but it didnt work – xuandl Sep 20 '13 at 21:30

0 Answers0