【发布时间】:2013-10-24 13:03:03
【问题描述】:
我正在将图像保存在存储器中,但图像质量因压缩而丢失。那么如何在不压缩的情况下保存图像。 我正在使用以下代码
//Creating bitmap from Resource id
Bitmap bitmap=BitmapFactory.decodeResource(getResources(), BitmapId);
String extStorage=Environment.getExternalStorageDirectory().toString();
File file = new File(extStorage, "name.png");
if(file.exists())
file.delete();
try {
outStream = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream);
.....
}
请告诉我如何保存图像而不损失其质量..
【问题讨论】: