cache images

Former Member
Former Member
Hi all,
I would like to cache some small images, I tried to store them with App.setProperty(key, bitmap) but I get a type error.

Any idea on how to cache bitmaps, it is possible?

Thanks in advance!
Stefano
  • As I understand it makeImageRequest() doesn't work yet, so I'm not sure how you're getting an image onto the device outside of compiling it in. Regardless, I don't see any way that you can cache the image data for later use. I've asked the question previously, and got no response.
  • IIRC, the max size of the Object Store is 8k (less, if that would push things over 64k), so not sure what you could really do image wise in the Object Store.

    And as Travis mentioned, where would you be getting the bitmap from?
  • Former Member
    Former Member over 10 years ago
    Thanks for your comments,
    I had to convert my images into strings (quite short actually), send them with makeJsonRequest and then convert back on the watch.
    In this way I can also save them with the persistence service offered by the App class.

    I have to say that this works just fine because of the nature of my images, for next version I will need to find a better cache solution.
  • Okay, now you've piqued my interest. To be able to draw the bitmap, you'd have to have something that resembles the data that would be generated by the resource compiler (Ui.BitmapResource). I suppose you had to figure out the format that the resource compiler generates and then you just have to convert the JSON data to that. Is this what you've done?
  • Former Member
    Former Member over 10 years ago
    Hi Travis,
    I am sorry but no, I found another way I can rebuild the images with Dc methods with polygons.

    I can do that because of the kind of images of course.

    ciao

    Okay, now you've piqued my interest. To be able to draw the bitmap, you'd have to have something that resembles the data that would be generated by the resource compiler (Ui.BitmapResource). I suppose you had to figure out the format that the resource compiler generates and then you just have to convert the JSON data to that. Is this what you've done?
  • So these aren't images, they are rendering instructions (like vector graphics). That makes a whole lot more sense.