GetThumbnail() public method

public GetThumbnail ( ThumbnailRenderer thumbnailRenderer ) : Bitmap
thumbnailRenderer ThumbnailRenderer
return System.Drawing.Bitmap
Example #1
0
 public Bitmap this[ScannedImage scannedImage]
 {
     get
     {
         var newState = scannedImage.GetThumbnailState();
         if (cache.ContainsKey(scannedImage))
         {
             // Cache hit
             var item = cache[scannedImage];
             if (item.State != newState)
             {
                 // Invalidated
                 item.Thumbnail.Dispose();
                 item.Thumbnail = scannedImage.GetThumbnail(thumbnailRenderer);
                 item.State     = newState;
             }
             return(item.Thumbnail);
         }
         else
         {
             // Cache miss
             var item = new CacheItem
             {
                 Thumbnail = scannedImage.GetThumbnail(thumbnailRenderer),
                 State     = newState
             };
             return(item.Thumbnail);
         }
     }
 }
Example #2
0
 public Bitmap this[ScannedImage scannedImage]
 {
     get
     {
         var newState = scannedImage.GetThumbnailState();
         if (cache.ContainsKey(scannedImage))
         {
             // Cache hit
             var item = cache[scannedImage];
             if (item.State != newState)
             {
                 // Invalidated
                 item.Thumbnail.Dispose();
                 item.Thumbnail = scannedImage.GetThumbnail(userConfigManager.Config.ThumbnailSize);
                 item.State = newState;
             }
             return item.Thumbnail;
         }
         else
         {
             // Cache miss
             var item = new CacheItem
             {
                 Thumbnail = scannedImage.GetThumbnail(userConfigManager.Config.ThumbnailSize),
                 State = newState
             };
             return item.Thumbnail;
         }
     }
 }
Example #3
0
        private static void AddTransformAndUpdateThumbnail(ScannedImage image, Transform transform)
        {
            image.AddTransform(transform);
            var thumbnail = image.GetThumbnail(null);

            if (thumbnail != null)
            {
                image.SetThumbnail(transform.Perform(thumbnail));
            }
        }
Example #4
0
        private void AddTransformAndUpdateThumbnail(ScannedImage image, ref Bitmap bitmap, Transform transform)
        {
            image.AddTransform(transform);
            var thumbnail = image.GetThumbnail(null);

            if (thumbnail != null)
            {
                bitmap = transform.Perform(bitmap);
                image.SetThumbnail(thumbnailRenderer.RenderThumbnail(bitmap));
            }
        }
Example #5
0
 private static void AddTransformAndUpdateThumbnail(ScannedImage image, Transform transform)
 {
     image.AddTransform(transform);
     var thumbnail = image.GetThumbnail(null);
     if (thumbnail != null)
     {
         image.SetThumbnail(transform.Perform(thumbnail));
     }
 }