I am developing an application in which I am rotating image using following code.
Bitmap bmpOriginal = BitmapFactory.decodeResource(this.getResources(), R.drawable.image2);
Bitmap bmResult = Bitmap.createBitmap(bmpOriginal.getWidth(), bmpOriginal.getHeight(), Bitmap.Config.ARGB_8888);
Canvas tempCanvas = new Canvas(bmResult);
tempCanvas.rotate(-10, bmpOriginal.getWidth()/2, bmpOriginal.getHeight()/2);
tempCanvas.drawBitmap(bmpOriginal, 0, 0, null);
mImageView.setImageBitmap(bmResult);
Taken from Rotating a drawable in Android
but the image get clipped from edges something similar to this
I have searched the internet but I cannot resolve it. I know that i have to increase the size of bmResult.I also tried doing that but still some edges got clipped .
If any body can give me clue or solve the problem following is my Imageview xml code
<ImageView
android:id="@+id/img"
android:layout_width="45dp"
android:layout_height="45dp" >
</ImageView>
Thanks