ImageCache use?


#1

Adding an image to the ImageCache requires a hashcode.   What if the image we're adding is procedurally generated?  

I have a bunch of images that i'd like to cache and they're all generated procedurally, and therefore I don't have a hashcode for them.  in the demo examples, i saw that you used the file size stored in the binarydata.h as the hashcode for images that are stored on disk(or compiled).  

what's the best way to do this?   I don't want to keep recomputing the images each time i need one; i'd like to just pull them from the cache.  they're dependent on window size which is why they're procedurally generated.  i'm drawing LOTS of them, so i would much rather call Graphics::drawImageAt() vs. all of the code currently used to draw one image. 


#2

Well, if you can generate the image, you can also generate a hash code in whatever way is appropriate - that's the way it's intended to work.