We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Ok so I am developing a sketch that requires loading in alot of images.
I have two type Gifs and pngs. I am getting a slow sketch at startup and sometimes an out of memory error. I know this is due to loading alot of images at start-up.
I just want to know if there is a java or processing method for loading and trashing images dynamically or loading them outside of setup() only when needed to be drawn??
Cheers in advance
Answers
so say I queue the Pimages, do I have to do that in setup or can I do it in its own class outside of setup?
BTW I will not need to display more than 2 of the loaded images at once... I just thought all loadimage() had to be in setup??
If we got RAM, it's practical to load everything in setup()!
It's always forward, or does it have rewind?
If it's always forward, a Queue of loaded images is enough.
Otherwise, you'd need 2 Deque instead!
look at page three of General share your work, my image loading prog may help. Can load many images, if available memory. will play all images in a buffer, stops at last buffer image until all are complete.
regards, Algwat