private static FileBitmapImage LoadFromIsolatedStorageBitmap(string fileName) { FileBitmapImage Result = null; try { IsolatedStorageFile storage = GetStorageRoot(); IsolatedStorageFileStream fs = storage.OpenFile(fileName, FileMode.Open); Result = new FileBitmapImage(storage, fs); } catch (Exception e) { PrintException(e, "Load Bitmap", fileName); } return(Result); }
public static FileBitmapImage LoadBitmap(string fileName) { string Source = ToISFileName(fileName); if (!IsolatedStorageFileExists(Source)) { return(null); } if (BitmapCache.ContainsKey(Source)) { return(BitmapCache[Source]); } else { FileBitmapImage Result = LoadFromIsolatedStorageBitmap(Source); if (Result != null) { BitmapCache.Add(Source, Result); } return(Result); } }