問題描述
Android 使用手勢移動和縮放 (Android using hand gestures to move and zoom)
I have an image that gets created once a button gets clicked; it gets created in the middle of the canvas, as I set it to do so:
if(choosenImage != null) {
c.drawBitmap(choosenImage, 0, 0, null);
}
I want to move and zoom the image using my hand, like drag to to, move it, etc.
How can I do that ? And is that related to onTouchListener
?
參考解法
方法 1:
Yes it is related to OnTouchListener. I think code on the following link will solve your problem:
Rotate zoom drag image in android imageview
(by John Jared、kzs)