对一个图片进行旋转90度,然后再保存下来,旋转没问题,不知到为什么旋转后的图片
越来越模糊,多旋转几次,就黑成一片了,我试过把原图删掉,再保存,还是这样,这是
我的代码,哪位帮忙解答一下。。
String path = app.getImages().get(app.getCurrentIndex())
.get(IMAGE_DATA);
Bitmap bitmap = BitmapFactory.decodeFile(path);
Matrix matrix = new Matrix();
matrix.postRotate(90);
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),
bitmap.getHeight(), matrix, false);
File file = new File(path);
if (file.exists()) {
file.delete();
}
// TODO
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.flush();
bos.close();
finish();