Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 importing pictures.
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
awakening_64




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
HellblazerX




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: