I'm trying to store different images in some components.
The first thing I tried was saving a pointer to the binary image data and its length in the properties (NamedValueSet) of the components. I wanted to use this information to load the image from the static ImageCache with getFromMemory. But I quickly found out that I can't save a pointer in a NamedValueSet.
My second idea was to just store the image itself in the NamedValueSet, but the NamedValueSet doesn't support that either.
My third idea was to add the Images to the ImageCache with addImageToCache and store the hash value (int64) in the NamedValueSet. That did work. But the problem is the ImageCache timeout deletes my Images. So that, too, is not an option.
Is there a canonical way to do what I want to do or do I need to sublass my components just to add the image or will I have to make my own static image cache (I'd probably just use a map)?