解决三星手机图片旋转
2016-12-20 本文已影响15人
43d60efa37c7
public static Bitmap getBitmap(String path){
Bitmap img = BitmapFactory.decodeFile(path);
Matrix matrix = new Matrix();
matrix.postRotate(readPictureDegree(path)); /*翻转*/
int width = img.getWidth();
int height =img.getHeight();
img = Bitmap.createBitmap(img, 0, 0, width, height, matrix, true);
return img;
}