private void CacheImage(CacheKey key, IntPtr src) { Bitmap newBitmap = new Bitmap(Image.FromHbitmap(src)); CacheEntry entry = new CacheEntry(newBitmap, 1); m_cache.Add(key, entry); }
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); } }