将位图图像保存到目录路径 [英] saving bitmap image to a directory path

查看:96
本文介绍了将位图图像保存到目录路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个位图图像,该图像由我的应用程序中的方法返回,现在我想将该图像保存到文件目录中.请帮助我


谢谢.

i am having a bitmap image that is return by a method in my application now i want to save that image to a file directory. pls help me out


thanks.

推荐答案

该文件是什么格式?将其转换为字节数组,可能已经有一个可用的函数.

此代码与String相同:
What format is that file? turn it into a byte-Array, there might be a function for that already available.

This code does the same with a String:
String strFilePath = "demo.txt";  
try {
  FileOutputStream oStream = new FileOutputStream(strFilePath);
  String strContent = "Write File using Java FileOutputStream example !";
  oStream.write(strContent.getBytes());
  oStream.close();
}
catch(Exception oException) {
  System.out.println("OOOPS : " + oException);
}


这篇关于将位图图像保存到目录路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆