NAPS2.Scan.Images.ThumbnailRenderer.RenderThumbnail C# (CSharp) Method

RenderThumbnail() public method

public RenderThumbnail ( Bitmap b ) : Bitmap
b System.Drawing.Bitmap
return System.Drawing.Bitmap
        public Bitmap RenderThumbnail(Bitmap b)
        {
            return RenderThumbnail(b, userConfigManager.Config.ThumbnailSize);
        }

Same methods

ThumbnailRenderer::RenderThumbnail ( Bitmap b, int size ) : Bitmap
ThumbnailRenderer::RenderThumbnail ( ScannedImage scannedImage ) : Bitmap
ThumbnailRenderer::RenderThumbnail ( ScannedImage scannedImage, int size ) : Bitmap

Usage Example

Example #1
0
 public void PostProcessStep2(ScannedImage image, Bitmap bitmap, ScanProfile profile, ScanParams scanParams, int pageNumber, bool supportsNativeUI = true)
 {
     if (!scanParams.NoThumbnails)
     {
         image.SetThumbnail(thumbnailRenderer.RenderThumbnail(bitmap));
     }
     if (scanParams.SkipPostProcessing)
     {
         return;
     }
     if (profile.StretchHistogram && !profile.HistogramStretchConfig.IsNull)
     {
         AddTransformAndUpdateThumbnail(image, ref bitmap, new StretchHistogramTransform {
             Parameters = profile.HistogramStretchConfig
         });
     }
     if ((!profile.UseNativeUI || !supportsNativeUI) && profile.BrightnessContrastAfterScan)
     {
         if (profile.Brightness != 0)
         {
             AddTransformAndUpdateThumbnail(image, ref bitmap, new BrightnessTransform {
                 Brightness = profile.Brightness
             });
         }
         if (profile.Contrast != 0)
         {
             AddTransformAndUpdateThumbnail(image, ref bitmap, new TrueContrastTransform {
                 Contrast = profile.Contrast
             });
         }
     }
     if (profile.FlipDuplexedPages && pageNumber % 2 == 0)
     {
         AddTransformAndUpdateThumbnail(image, ref bitmap, new RotationTransform(RotateFlipType.Rotate180FlipNone));
     }
     if (profile.AutoDeskew)
     {
         var op = operationFactory.Create <DeskewOperation>();
         if (op.Start(new[] { image }))
         {
             operationProgress.ShowProgress(op);
             op.Wait();
         }
     }
     if (scanParams.DetectPatchCodes && image.PatchCode == PatchCode.None)
     {
         image.PatchCode = PatchCodeDetector.Detect(bitmap);
     }
 }
All Usage Examples Of NAPS2.Scan.Images.ThumbnailRenderer::RenderThumbnail