Skip to main content

flush() method of Image

1 reply [Last post]
bloomfield
Offline
Joined: 2008-01-28
Points: 0

Hello there,

again i have a problem with images (standard AWT Image). I want to display a large series of large images.

I load the first one (with the createImage method from the Toolkit),
then (by pressing a key) i flush it and load and display the next and so on.
So i always have only one image loaded at a certain time.
Anyhow, when it comes to the 15th or so (depending on the image sizes) image i just get a blank screen. It seems as if i am out of (image buffer) memory.
I also read the wiki on dealing with images but had no success.

Does anyone know if the flush() method really frees the buffer memory immediately or if it takes a little while. What else do i have to keep in mind dealing with the flush() method??

Cheers
Jan

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bloomfield
Offline
Joined: 2008-01-28
Points: 0

Hello again,

i think i found the solution. The problem was: I didn't remove the image from the Mediatracker object. After doing this, flush() seems to work.

Cheers
Jan