Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public VideoBagCachedProvider()
 {
     videoBag          = new VideoBagStream();
     cachedBitmapArray = new Bitmap[videoBag.GetAllEntries().Length];
     DrawOffsets       = new int[cachedBitmapArray.Length][];
 }