我正在开发一个将绘制的画布作为 jpeg 图像存储在 SD 卡中的应用程序。问题是当我尝试查看保存的图像时,它比其他图像加载了很多时间我希望像其他图像一样在正常时间查看保存的图像我保存图像的代码是:
View content = drawView;
content.setDrawingCacheEnabled(true);
content.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW);
Bitmap bitmap = content.getDrawingCache();
String path = Environment.getExternalStorageDirectory().getAbsolutePath();
String file_name="Imatge"+System.currentTimeMillis()+".jpg";
File file = new File(path,file_name);
FileOutputStream ostream;
try {
ostream = new FileOutputStream(file);
bitmap.compress(CompressFormat.PNG,50, ostream);
ostream.flush();
ostream.close();
Toast.makeText(getApplicationContext(), " :) Image saved in "+ path+"/"+file_name, 5000).show();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(), e.toString()+"error", 5000).show();
}
}
提前谢谢请帮帮我!!!!