Android学习之保存Bitmap到指定目录
/** * 保存图片到指定目录 * * @param bmp * @param filename * @return */ private boolean saveBitmapTofile(Bitmap bmp, String filename) { if (bmp == null || filename == null) return false; CompressFormat format = Bitmap.CompressFormat.JPEG; int quality = 100; OutputStream stream = null; try { stream = new FileOutputStream("/sdcard/myimage/" + filename); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return bmp.compress(format, quality, stream); }