This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 9521
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: 9521
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: 9521
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!