Android: How To Draw A Rectangle On A Movable Image Such That The Drawn Rectangle Also Moves Along With The Image?
I have an image which is movable throughout the screen. Now, I want to draw a rectangle on this image such that when I move the image the rectangle drawn on the image also moves. C
Solution 1:
Well I figured my own way. It was just a small change in the above code which was necessary. It is enough to define the co-ordinates of rectangle with respect to x and y obtained due to touch events. for example, you can do the following:
myRectangle.set(x-50, y-50, x+50, y+50);
And the rest will be taken care automatically.
Post a Comment for "Android: How To Draw A Rectangle On A Movable Image Such That The Drawn Rectangle Also Moves Along With The Image?"