Stirling - Storing a Bitmap

Sep 25, 2011 at 7:48 AM

Hi For a WP7 app than I am writing, I would like to be able to store a small bitmap in the sterling database.  Is this possible and if, so how do would I define it and access it?


- thanks - Peter

Sep 25, 2011 at 3:18 PM

Sterling supports this out of the box. Simply define the property as a WriteableBitmap. It will automatically save and restore.

Sep 25, 2011 at 3:19 PM

PS - take a look at the unit tests. There is an example of saving/restoring a bitmap image.

Sep 26, 2011 at 11:28 PM

Thanks for this.   I have downloaded the source... I assume thats where it is (the example).  There seem to be a number of solutions ... which one should I open to get to the example?  (sorry - newsish to .NET and VS and this is a larger project than I have been working with  up to now!)

And .. just a  query about what I am doing... I am writing a WP7 app and I am generating a bitmap for use and the image in a live tile.   I cannot do this in the Periodic task because I cannot use a textblock etc withi the background thread.  So,  I am generating a bitmap within the foreground phone app - storing it in isolated storage and retrieving that within my periodic task and presenting that image as part of my live tile.   It works ok, but  given the bitmap is directly associatred with an object in my DB then it would be cleaner to store and manage it with  its object.

Just wondering if you had any thoughts on this around - are there performance reasons not to store in the DB?  I understand that the periodic task has contraints around memory usage - would moving the image to the database affect this?

- thanks