We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm running the latest version 0.16.9 from NuGet.
BarcodeReader reader = new BarcodeReader(); reader.AutoRotate = true; reader.Options.TryInverted = true; reader.Options.TryHarder = true; reader.Options.PossibleFormats = new List<ZXing.BarcodeFormat>(); reader.Options.PossibleFormats.Add(ZXing.BarcodeFormat.QR_CODE); var result = reader.Decode(bitmap);
The text was updated successfully, but these errors were encountered:
After compressing the image, it can be parsed. Is the image quality too high to be parsed?
BarcodeReader reader = new BarcodeReader(); reader.AutoRotate = true; reader.Options.TryInverted = true; reader.Options.TryHarder = true; reader.Options.PossibleFormats = new List<ZXing.BarcodeFormat>(); reader.Options.PossibleFormats.Add(ZXing.BarcodeFormat.QR_CODE); //compress pictures bitmap = CompressImage(bitmap); var result = reader.Decode(bitmap); /// <summary> /// compress pictures /// </summary> /// <param name="image"></param> /// <param name="width">Target width</param> /// <returns></returns> public static Bitmap CompressImage(Bitmap srcBmp, int width) { int srcWidth = srcBmp.Width; //if (srcWidth <= width) //{ // return srcBmp; //} int height = (int)(srcBmp.Height * (width / (double)srcWidth)); Bitmap bmp = new Bitmap(width, height); using (Graphics gr = Graphics.FromImage(bmp)) { gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed; gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed; //Setting to HighQualityBicubic cannot be resolved gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Low; System.Drawing.Rectangle rectDestination = new Rectangle(0, 0, width, height); gr.DrawImage(srcBmp, rectDestination, 0, 0, srcBmp.Width, srcBmp.Height, GraphicsUnit.Pixel); } return bmp; }
Sorry, something went wrong.
No branches or pull requests
I'm running the latest version 0.16.9 from NuGet.
The text was updated successfully, but these errors were encountered: