【发布时间】:2011-12-08 13:55:55
【问题描述】:
我正在尝试将图像保存在 sd 卡中,例如:
Bitmap bitmap=Bitmap.createBitmap(400, 300, Bitmap.Config.ARGB_8888);
Canvas canvas=new Canvas(bitmap);
imageView.draw(canvas);
file = new File(folder, "temp.jpg");
try {
outStream = new FileOutputStream(file);
bitmapP.compress(Bitmap.CompressFormat.JPEG, 100, outStream);
outStream.flush();
outStream.close();
return file.toString();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
现在我得到如下图像:
Bitmap bitmap = BitmapFactory.decodeFile(image);
我有位图,但我的位图质量变得模糊...... 我做错了什么?
任何人都可以帮助我吗? 谢谢
【问题讨论】:
-
如果使用 CompressFormat.PNG,质量会更好吗?
标签: android bitmap drawable sd-card