Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

image input and output  RSS feed

 
Joel Karimpil
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

is it possible to read an image in binary form and then output it?
if so, how?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.imageio package would be a good start.
 
Basanth P Rangadhol
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried using ImageIO class.. but the ImageIO.read(File f), and ImageIO.read(ImageInputStream is).. did not worked??.. they are returning a null. please help???...
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We need a little more information. Like code, exceptions if they are being thrown, what kind of image you are reading, etc.
 
Basanth P Rangadhol
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.. i tried to display "image.ico" file... but when i tried with "image.gif" file, i got it.. but please can u help to read an icon file and write it??..
 
Basanth P Rangadhol
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try
{
file = new File("D:/JBuilder7/samples/editor/bullet.gif");
inputStream = ImageIO.createImageInputStream(file);
scannedImage = ImageIO.read(inputStream);
}catch(MalformedURLException url) { System.out.println("error
during icon file access"); }
catch(IOException ioe) { System.out.println("error during icon
creation"); }

also.. i have heard it is not possible to display an "*.ico" file on a button.. please help??..

[ November 30, 2004: Message edited by: Basanth P Rangadhol ]
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Advanced Imaging API FAQ: What image file formats are supported?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!