I am trying to rotate an image. Rotation is perfectly working but when I get that rotated image back getting some blank space. What should I do for remove that blank space?
I have tried this code:
public static Bitmap RotateBitmap(Bitmap source, float angle) {
Matrix matrix = new Matrix();
matrix.setRotate(90, 0, 0);
matrix.postTranslate(source.getHeight(), 0);
// matrix.postRotate(angle);
return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true);
}
Utility.tempBitmap = RotateBitmap(Utility.tempBitmap, -90);