Skip to main content
GameDev.net gamedev.net
🔒 Locked

java: getImage: avoiding cache

Started by emileej May 6, 2004 at 10:46 AM 1 replies 400+ views
Original Post
emileej
emileej
I am loading an image from my applet using getImage, but when the image is updated and my applet calls getImage again, I am given the old image - ergo I must be getting it from some cache. How do I force java to reload the image?
Emil Johansen- SMMOG AI designerhttp://smmog.com
nonnus29
nonnus29
getImage() loads the image from a file and returns an Image. So if you call it multiple times you are reloading the same image from the file (which will overright you changed image if your using the same Image object). Are you saving the image after you change it then expecting to reload the change? Not sure I'm following you here...

PS there is a java forum further down on the page were these questions will get more knowledgable responses...

[edited by - nonnus29 on May 6, 2004 12:52:45 PM]
emileej
emileej
Thanks. Ill ask the question there, but what youre sying is exactly what I am doing and the image does not get reloaded properly so I am guessing it loads from a cache.
Emil Johansen- SMMOG AI designerhttp://smmog.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.