Okay, so your basic problem is that your image isn't done being loaded when you're calling the getWidth() and getHeight() functions. The API for Image actually explains that.
There are two ways...
Type: Posts; User: KevinWorkman
Okay, so your basic problem is that your image isn't done being loaded when you're calling the getWidth() and getHeight() functions. The API for Image actually explains that.
There are two ways...
There are a few things that stick out to me, but the most glaring is how you're trying to do your painting. If you're calling getGraphics() on anything other than an Image, you're doing something...
Ack! No, please don't do that either. I'm sorry, I'm not trying to be obnoxious, but it's really important that we see the actual code you're running- without having to wade through so much extra...
Sorry, but I don't really think that's enough. I wanted an SSCCE so I could see all of the major pieces- initializing the image, etc. Plus it's easier to help if I can just copy and paste your code...
Would you mind throwing together an SSCCE that demonstrates how you're trying to do this?
What ImageObserver are you trying to use?