tags:

views:

183

answers:

2

I'm using Graphics2D.drawImage to draw an image into a BufferedImage. Then I Use ImageIO.write() to output this to a PNG. Often I don't see certain images that I painted this way.

I assume this is because drawImage is an asynchronous operation and I need to wait for it to complete. I've tried implementing an ImageObserver but without success.

Can anybody show me how it's done ?

+1  A: 

java.awt.MediaTracker is a relatively easy way to make sure that an image has loaded.

Tom Hawtin - tackline
A: 

What did you try when you implemented ImageObserver? Can you post a representative code snippet?

Kevin Herron