Search code examples
sqlitewin-universal-appbitmapimagestoragefile

UWP saving and retrieving storagefile from a database


I want to save and retrieve StorageFile and bitmap images into Sqlite database. and then retrieve them later on. and bitmapimage will be from thumbnail of that file. thnks in advance


Solution

  • As I have already told saving StorageFile and BitMapIamge to database is not a good idea. Database might choke if image file is big. Instead save path of image to db. You can load image using Path like this

    myImage.Source = new BitmapImage(new Uri(   "ms-appx:///Assets/WorldCupFlags/Sri_Lanka.png", UriKind.Absolute));
    

    And StorageFile you can't store it to database.