Click here to Skip to main content
12,754,391 members (33,233 online)
Rate this:
Please Sign up or sign in to vote.
See more: Java
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

Posted 8-Oct-12 0:59am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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 !";
catch(Exception oException) {
  System.out.println("OOOPS : " + oException);
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 @

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170217.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100