I want to rotate a imageview around a point. The imageview is referring to a drawable resource.
Then I am converting the imageview to bitmap so that i can draw it on canvas.
With the help of this i am able to draw the drawable on the canvas
imageView = new ImageView(this);
imageView.setImageResource(drawable);
imageView.setDrawingCacheEnabled(true);
imageView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
imageView.layout(0, 0, imageView.getMeasuredWidth(), imageView.getMeasuredHeight());
imageView.buildDrawingCache(true);
Matrix matrix = new Matrix();
matrix.setRotate(30,x, y);
canvas.drawBitmap(imageView.getDrawingCache(), matrix, paint);
The matrix is not working. The image is not rotaing at the point x, y.
Can anyone tell me what i am missing in my code ?