/** * 保存图片到指定文件夹 * * @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); }
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-23 21:23:57