android - Bitmap coordinates after canvas.scale -
i need @ getting correct coordinates when touching canvas.
i have image 1240x1756
the user can scroll around on bitmap. bitmap attached canvas. translating canvas. canvas.translate()
the user can place new bitmap , move anywhere around on canvas. 256x256.
up until point have no problem calculating touch coordinates @ scale factor of 1.0. take screen touch coords , add offset of image , check see if 256x256 moveable bitmap intersects touch coords.
however issue getting correct coordinates after canvas has been scaled. 0.1-1.0 minimum , maximum scaling values.
can point me in right direction working algorithm?
you should able multiply pixel offset 1/scale factor.
Comments
Post a Comment