The question is simple: I want to rotate the image around a specific pivot point. Here is the code I'm using:
Matrix matrix = new Matrix(); matrix.setTranslate(bmpWidth/2, 0); matrix.preRotate(degrees, bmpWidth/2, 0); Bitmap resizedBitmap = Bitmap.createBitmap( bitmap, 0, 0, bmpWidth, bmpHeight, matrix, true); ImageView imageView = (ImageView) findViewById(R.id.bell); imageView.setImageBitmap(resizedBitmap);
I get degrees of rotation from the accelerometer sensor. As a result, every time the image rotates around its center point,
source share