private Bitmap CacheBitmap(int index) { // Check for overflow if (activeCachedBitmaps > CACHED_BITMAPS_MAX_ACTIVE) { ClearCachedLists(); } activeCachedBitmaps++; VideoBagStream.FileEntry[] entries = videoBag.GetAllEntries(); // Read bitmap from stream int ox, oy; Bitmap bit = videoBag.GetBitmap(entries[index], out ox, out oy); // Store offset and bitmap pointer DrawOffsets[index] = new int[] { ox, oy }; cachedBitmapArray[index] = bit; return(bit); }
public VideoBagCachedProvider() { videoBag = new VideoBagStream(); cachedBitmapArray = new Bitmap[videoBag.GetAllEntries().Length]; DrawOffsets = new int[cachedBitmapArray.Length][]; }