Beispiel #1
0
        private ImageCache(int maxCacheSize)
        {
            int safeMaxCacheSize = GetMaxCacheSize(maxCacheSize);

            // consider low treshold as a third of maxCacheSize
            int lowTreshold = safeMaxCacheSize / 3;

            _cache = new ReuseBitmapDrawableCache(safeMaxCacheSize, lowTreshold, safeMaxCacheSize);
        }
Beispiel #2
0
        private ImageCache(int maxCacheSize, IMiniLogger logger)
        {
            int safeMaxCacheSize = GetMaxCacheSize(maxCacheSize);

            // consider low treshold as a third of maxCacheSize
            int lowTreshold = safeMaxCacheSize / 3;

            _cache             = new ReuseBitmapDrawableCache(logger, safeMaxCacheSize, lowTreshold, safeMaxCacheSize);
            _imageInformations = new ConcurrentDictionary <string, ImageInformation>();
        }
        private ImageCache(int maxCacheSize, IMiniLogger logger, bool verboseLogging)
        {
            _logger = logger;
            int safeMaxCacheSize = GetMaxCacheSize(maxCacheSize);

            double sizeInMB = Math.Round(safeMaxCacheSize / 1024d / 1024d, 2);

            logger.Debug(string.Format("Image memory cache size: {0} MB", sizeInMB));

            // consider low treshold as a third of maxCacheSize
            int lowTreshold = safeMaxCacheSize / 3;

            _cache             = new ReuseBitmapDrawableCache(logger, safeMaxCacheSize, lowTreshold, safeMaxCacheSize, verboseLogging);
            _imageInformations = new ConcurrentDictionary <string, ImageInformation>();
        }