Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

King of Men

Loading images in Java

This topic is 5213 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to use a JPG as the introduction screen for a game. I have gotten as far as loading an Image through the Toolkit.createImage(filename) method. However, Image is an abstract class; I don''t quite understand how to convert it to a BufferedImage. Maybe I don''t need this right now, but I''d still like to understand how Java''s image-handling works. Can anyone help me with this? I''ve tried looking through the API specification, but I have not found any Image-to-BufferedImage information. Does Toolkit automatically produce a BufferedImage, so it''s safe to use typecasting? I''m confused!

Share this post

Link to post
Share on other sites
Use ImageIO.read() to load images.


[edited by - nonnus29 on June 9, 2004 8:12:16 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!