java - How to rotate image view? -
i'm having problems while trying rotate picture java android canvas.drawimage. i'm doing little game, , i'm painting different pictures on screen using drawimage function. want rotate little images, have created function called drawmirroredimage this. little images don't appear on same place.
here code:
public void drawimage(image image, int x, int y) { canvas.drawbitmap(((androidimage) image).bitmap, x, y, null); } public void drawmirroredimage(image image, int x, int y) { canvas.save(); canvas.scale(-1.0f, 1.0f); canvas.drawbitmap(((androidimage) image).bitmap, x - canvas.getwidth(), y, null); canvas.restore(); } anyone knows i'm doing wrong?
lot of helping
try code rotating image view.
matrix mx=new matrix(); myimageview.setscaletype(scaletype.matrix); mx.postrotate((float) angle, pivx, pivy); myimageview.setimagematrix(mx);
Comments
Post a Comment