Computer Science Canada

importing pictures.

Author:  awakening_64 [ Sun May 25, 2008 4:06 pm ]
Post subject:  importing pictures.

im not sure if in java you are able to upload pictures like you would with a normal text file. if so, could someone please write me the syntax for it?

Author:  HellblazerX [ Mon May 26, 2008 1:37 pm ]
Post subject:  Re: importing pictures.

You can use the ImageIO class for this:
code:
BufferedImage img;
try {
     img = ImageIO.read (new File ("filename"));
catch (IOException e) {
}

Also, don't forget to import the ImageIO class, or you can't use it.
code:
import javax.imageio


: