Cattells
2018-12-06 02:04安卓保存素描图片失败
51,描述问题,我们的一个app功能是转换素描图片,转换以后放到imageView里面是没问题的。但是保存以后,直接找到那个文件,打开却是没有转换的图片。
2,我们的保存文件的方法是
public static void saveFile(Context context,Bitmap bm, File file)
throws IOException {
BufferedOutputStream bos = new BufferedOutputStream(new
FileOutputStream(file));
bm.compress(Bitmap.CompressFormat.PNG, 100, bos);
bos.flush();
bos.close();
}
转换后保存的代码是
@Override
protected void onPostExecute(Bitmap result) {
mDialog.dismiss();
if (result != null) {
mConvertedBitmap = result;
try {
PhotoClipperUtil.saveFile(getApplicationContext(), result, clipFile);
} catch (IOException e) {
e.printStackTrace();
}
picture.setImageBitmap(result);
}
}
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- 为什么输出图像文件大于使用imagick的输入?
- php
- imagick
- 1个回答