• Post Reply Bookmark Topic Watch Topic
  • New Topic

Loading Images  RSS feed

 
Ahuva Back
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to try and draw and Image that I have saved. I want to do this from and application and not an applet. I am using the Toolkit.getDefaultToolkit.getImage to get the image. Then the graphics method drawImage in a while loop ( while (!gr.drawImage(....))repaint)
This is taking a very long time to display the image and slows down all other threads - is there anything I can do?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not try to draw the Image until it is fully loaded from the file. Image loading takes place in a separate Thread - your code is bogging down that Thread by repeated repaint requests. Take a look at java.awt.MediaTracker.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!