OcrLibrary.Helpers.Screenshot.Resize C# (CSharp) Method

Resize() public method

need to resize the image to 300dpi, otherwise tesseract will not be able to recognize anything TODO: often fails due to some memory problems (invalid parameter)
public Resize ( ) : void
return void
        public void Resize()
        {
            if (Image == null) return;
            const int dpi = 300;
            const int scale = dpi / 96; // 96 is default
            var width = Image.Width * scale;
            var height = Image.Height * scale;
            var result = new Bitmap(Image, width, height);
            Image = result;
            Save("resizing");
        }