1Matrix matrix = new Matrix();
2
3matrix.postRotate(90);
4
5Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmapOrg, width, height, true);
6
7Bitmap rotatedBitmap = Bitmap.createBitmap(scaledBitmap, 0, 0, scaledBitmap.getWidth(), scaledBitmap.getHeight(), matrix, true);
8