關于顯示后,圖片旋轉
Bitmap bmp = BitmapFactory.decodeFile(pathName);
imageView.setImageBitmap(rotateImage(bmp));
private Bitmap rotateImage(Bitmap bmp) {
Matrix matrix = new Matrix();
matrix.postRotate(90);
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true) ;
}
為什么這樣不能實現 圖片的變換呢?有點奇怪了
2016-11-22
matrix.postRotate(90);的postXX方法一般用在非主線程中使用,比如用在surfaceView;?
2015-11-24
因為 我把這件事放在了 初始APP打開的那個Activity了,這段代碼是沒有問題的。