I'm new to android, I'm just experimenting at the moment and I'm having difficulty with a particular issue, rotating a bitmap image. More more specifically I'm getting really odd results when either the degree value is anything but 90, or 180 which both work fine. If a different value is provided my bitmap spins off the screen and it becomes very blurry.
(This rotation is triggered when someone touches the screen)
- Code: Select all
Example code I'm using is;
Matrix matrix = new Matrix();
matrix.setTranslate(this.xPos + (this.picture.getWidth() / 2), this.yPos + (this.picture.getHeight() / 2));
//Any value other than 90, or 180 causes the bitmap to spin off the screen and the bitmap becomes blurry.
matrix.postRotate(92, (this.xPos + this.picture.getWidth() / 2), (this.yPos + this.picture.getHeight() / 2));
this.picture = Bitmap.createBitmap(this.picture, 0, 0, this.picture.getWidth(), this.picture.getHeight(), matrix, true);
I'd be grateful for any assistance.