This project has moved and is read-only. For the latest updates, please go here.

Stirling - Storing a Bitmap

Sep 25, 2011 at 8: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 4: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 4:19 PM

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

Sep 27, 2011 at 12:28 AM

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