Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

image input and output  RSS feed

 
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?
 
Bartender
Posts: 9550
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.
 
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: 9550
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: 9550
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?
 
straws are for suckers. tiny ads are for attractive people.
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!