Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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:
Java
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);
}
 
Share this answer
 
Comments
Member 8943376 8-Oct-12 7:13am    
actually i have an image instance
TorstenH. 8-Oct-12 7:26am    
Check also this: Working with Images - the Java Tutorial @ oracle.com

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900