Giter Club home page Giter Club logo

zxing.net's Introduction

ZXing.Net

N|NuGet Build status Donate

ZXing.Net.Mobile Logo

Project Description

A library which supports decoding and generating of barcodes (like QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar) within images.

The project is a port of the java based barcode reader and generator library ZXing.
https://github.com/zxing/zxing
It has been ported by hand with a lot of optimizations and improvements.

The following barcodes are supported by the decoder: UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 93, Code 128, ITF, Codabar, MSI, RSS-14 (all variants), QR Code, Data Matrix, Aztec and PDF-417. The encoder supports the following formats: UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix

Assemblies are available for the following platforms:

  • .Net 2.0, 3.5, 4.x, 5.0, 6.0, 7.0
  • Windows RT Class Library and Runtime Components (winmd)
  • .NET Standard / .NET Core / UWP
  • Portable Class Library
  • Unity3D (.Net 2.0 built without System.Drawing reference)
  • Xamarin.Android (formerly Mono for Android)
  • bindings to Windows.Compatibility, CoreCompat.System.Drawing, ImageSharp, SkiaSharp, OpenCVSharp, Magick, Kinect V1 and V2, EmguCV, Eto.Forms, ZKWeb.System.Drawing
  • support COM interop, can be used with VBA

obsolete Assemblies are available for the following platforms up to release 0.16:

  • Windows Phone 7.0, 7.1 and 8.0
  • Windows CE
  • Silverlight 4 and 5

The library is available in the release section and as NuGet package, too.

Additional platform support without pre-built binaries

The library can be built for Xamarin.iOS (formerly MonoTouch). The project file and solution are available in the source code repository.

A special version for the .Net Micro Framework can be found in a separate branch in the source code repository.

The following demo clients are available:

  • decoder for the command line
  • encoder for the command line
  • Windows Forms demo (demonstrates decoding and encoding of static images and from a camera)
  • Windows Service demo (demonstrates decoding of static images)
  • Windows Presentation Framework demo (demonstrates decoding of static images)
  • Windows RT demo (demonstrates decoding of static images)
  • Windows Store App with HTML5/JS (demonstrates decoding of static images)
  • Unity3D and Vuforia demo (demonstrates encoding of barcodes and decoding of images from a camera with Unity3D)
  • EmguCV demo (demonstrates decoding of images from a camera and uses the EmguCV framework)
  • OpenCV demo (demonstrates decoding of images from a camera and uses the OpenCVSharp framework)
  • AForge demo (demonstrates decoding of images from a camera and uses the AForge framework)

Thanks

Many thanks to the team of the zxing project for their great work. ZXing.Net would not be possible without your work!

Usage examples

The source code repository includes small examples for Windows Forms, Windows Phone and other project types. Obsolete examples are available for the following platforms in separate branches: 0.16:

  • Silverlight 4 and 5,
  • Windows CE demo (demonstrates decoding of static images)
  • Windows Phone demo (demonstrates decoding of static images and from a camera)

small example decoding a barcode inside a bitmap (.Net 2.0/3.5/4.x)

// create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
   txtDecoderType.Text = result.BarcodeFormat.ToString();
   txtDecoderContent.Text = result.Text;
}

important notice for .Net Standard and .Net 5.0 and above target platforms

If you want to try the sample code above within a project which target .Net Standard or .Net 5.0 or higher then you have to add one of the additional nuget package for a specific image library: https://www.nuget.org/packages?q=ZXing.Bindings The main package of ZXing.Net for such platforms only contains the core classes which are not dependent on a specific assembly for image formats.

Help wanted

All help is welcome!

Feedback

You use the library? We would be happy if you give us a short note on the use of the library.

You found a bug? Please create a new issue here or start a discussion about it if you are not sure.

You use the library and you are not happy with it? Write us an email please or start a discussion about your problems with it. We will try to help you.

And you can find me on Twitter. N|http://twitter.com/micjahn

Support it

If you find the project useful and you wish to support the future development feel free to support it with a donation.

Donate

N|Donate

Beside a donation patches, bug reports, feedback and other useful help are always welcome!

Sponsors

Support us with a monthly donation and help us continue our activities. Become a sponsor and get your logo on our README on Github with a link to your site.

Donation WITHOUT money

It would be really, really great if you could support one of my social projects. You can support it WITHOUT paying money. You only have to go to the following url before you buy anything from a supported online shop (like Amazon or eBay):
http://www.bildungsspender.de/kitadorfhain
Select you prefered online shop and go shopping like everytime. The online shop will pay a provision to our Kindergarten for your purchase. No extra costs for you. There are 85 thankful kids. (and one thankful developer of ZXing.Net ;) )

zxing.net's People

Contributors

andriks2 avatar ayartsev-ast avatar brianpopow avatar camnewnham avatar ddrinka avatar deisterhold avatar dependabot[bot] avatar dimonkov avatar dkatyler avatar dlemstra avatar foostackdev avatar ghost1face avatar hanabi1224 avatar hangy avatar hig-dev avatar junian avatar kolozsaron avatar lordofdoom avatar mejevin avatar mfabruno avatar micjahn avatar miguelcriado avatar peruihkxt avatar primo-ppcg avatar skygate2012 avatar slimenull avatar spocweb avatar syonip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zxing.net's Issues

zxing .NET4.0 version is built against the ".NETFramework,Version=v4.6.1"

Hello,

I have a problem referencing one of my projects which is dependent on zxing. All my projects target .NET4.0. This is the error I get:

The primary reference "D:\fakepath\Assembly1.dll" could not be resolved because it has an indirect dependency on the assembly "zxing, Version=0.15.0.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60" which was built against the ".NETFramework,Version=v4.6.1" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

I double checked this and I'm sure I'm referencing the net40 version from the nuget package. Probably this version was built with net461?

Thanks,
Panayot

Getting Code 128 string

Have unusual requirement and was wondering it could use ZXing without mods. I am rpelacing an old Foxpro application which generates a Code 128 string into and extract. So not the bar code image, but the intermediate string after converting the raw string input internally to Code 128. for instance the free online encoder page from ID Automation (http://www.bcgen.com/fontencoder/) converts the string "MA$7#LXB #000074232088" to the corresponding Code 128 string "ÌMA$7#LXBÂÂ#ÇÂÂj74x.Î".

Because the consumer of my extract is not changing I need to be able to generate the string as the old app did. I expect that the string is generated within ZXing internally while generating a Code 128 barcode bitmap.

Am asking only if you can answer of the top of your head. If not, I'd be glad to go into the code and research myself.

Thanks in advance for any help and for mantaingin the great product....--Al-

Extra blank space on the right and bottom in the DataMatrix barcode bitmap image

I run the windowsformdemo in the project zxing.vs2015, and found there is Extra blank space on the right and bottom in the DataMatrix barcode bitmap image when set the height and width of the barcode.

Is there a way to avoid this , because the image is too small (height = 12 or 14) when using the default height and width?

Enum.TryParse("ALL_1D", out BarcodeFormat format) fails

[Searched and didn't see this so adding.]

The statement:

Enum.TryParse("ALL_1D", out BarcodeFormat format)

returns false. It should return true with the format variable filled with the BarcodeFormat.ALL_1D value. It works correctly with all the other recognized codes.

Generating PDF417 from hex

Is it possible to build a PDF417 barcode from HEX? I tried something with ZXing, but it wont work with an encoded string in my case.
HEX: fe-30-**09**-33-31-37-30-31-30-32-30-31-f9-20-**01**-34-fe-30-**01**-20-fc-20-**06**
I highlighted some Hexchars which won't work (e.g 09, 01, 06).
The main problem is that our HEX has to be converted into a string, before being able to generate a pdf417 barcode and no encoding (ascii, utf-8, etc.) supports those hexcharacters.
Is there a way to get a byte array into the generator or somehow make sure that, when reading the barcode, these characters will be displayed correctly?
Other than that ZXing fits all my needs, but I cant find a propper way of using my data in this case.

Strange indentation

Hi, I noticed you are using strange indentation in files - 3 spaces. Is it intentional or issue caused by auto conversion or sth?

Edit: I found many other code formatting issues and inconsistency, for example below there aren't spaces between arithmetic operators:

float q = distance(poutd, pouta)*nbCenterLayers/(distance(pind, pina)*(nbCenterLayers + 2));

but sometimes even in the same file, spaces appeared:

var pinax = new ResultPoint(pina.X + 0.5f, pina.Y - 0.5f);

Error compiling for HoloLens

Hello,

I'm trying to use zxing.unity.dll on the HoloLens. I'm so close.

When building, I'm getting the following error, related to System.ComponentModel.BrowsableAttribute:
Reference rewriter: Error: type System.ComponentModel.BrowsableAttribute doesn't exist in target framework.

There are about 4 of these errors that reference this namespace in various places. I saw a video online of someone who was successful in deploying ZXing to Unity/HoloLens, but they didn't mention this issue. I'm not sure if it's some version difference. But anyway, here are some specs:

  • Unity 5.5.1f1
  • ZXing.Net (not sure the version, but recent as of today)
  • Visual Studio 2015

Thank you!
Eric

Zxing horizontal default orientation (Unity3D)

Hi,
I'm using zxing on Unity3D and I noticed the default orientation is vertical. For my use case I need to scan horizontally but I can't find how to rotate the default scan orientation. For now I can make it work using both AutoRotate = true and TryHarder = true but it slow down the process (since each image is processed in different orientations).
Any idea of how to do that? Thanks.

DataMatrix inserts wrong character for FNC1

When encoding a DataMatrix the code substitutes ASCII character 29 (<GS>) with the FNC1 character where FNC1 is defined as (char)232. Code here

I believe this is a mistake.
ISO/IEC 16022:2006 Section 5.2.4.6 "FNC1 alternate data type identifier" (emphasis mine)

To encode data to conform to specific industry standards as authorised by AIM Inc., a FNC1 character shall appear in the first or second symbol character position (or in the fifth or sixth data positions of the first symbol of Structured Append). FNC1 encoded in any other position is used as a field separator and shall be transmitted as GS control character (ASCII value 29).

Essentially the FNC1 character used at the start of the DataMatrix and during the data are different, and the wrong one is being inserted.

Despite this, a DataMatrix produced using an FNC1 representation of 232 instead of 29 to delimit variable data still passes verification, but the output is not the same as other DataMatrix encoders I've seen.

I believe it can be fixed by replacing this else:

else
{
   if (c == 29)
   {
      context.writeCodeword((char)HighLevelEncoder.FNC1);
   }
   else
   {
      context.writeCodeword((char)(c + 1));
   }
   context.Pos++;
}

with this:

else
{
   context.writeCodeword((char)(c + 1));
   context.Pos++;
}

I suspected that the lookahead methods may need modifying to accept the GS character (\u001D). For example adding to the check isNativeText(char ch) in HighLevelEncoder.cs but I'm not sure about this.

internal static bool isNativeText(char ch)
{
   return (ch == ' ') || (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || ch == '\u001D';
}

Problems Encoding barcodes from VB6 using COM Interop

Using VB6 and the COM Interop module, I can retrieve the PixelData object, but am unable to retrieve the actual bitmap and place it in a picture box on screen.
I have tried several different APIs including OleLoadPicture from a Stream of bytes and assigning it to an IPicture etc. but nothing worked.
My solution was create a couple of new methods on IBarcodeWriter and the BarcodeWriter class to a) save the image as a BMP as it loads natively in VB6 whereas a PNG requires some API manipulation, and b) return the barcode bitmap as an IPicture that can be assigned directly to the PictureBox.Picture property.
This works nicely with VB6.

I can now use PictureBox.Picture = writer.write("text to be encoded as a barcode")

I have attached my modified version of the zxing.interop module
interop.zip

Divide by zero

RSS14Reader.cs

242 recordPattern(row, pattern.StartEnd[1] + 1, counters);
Return value is ignored. But recordPattern may return false.
And array will contains all zeros.
Then
253 float elementWidth = (float)ZXing.Common.Detector.MathUtils.sum(counters) / (float)numModules;
will be zero.
And error here
262 float value = (float)counters[i] / elementWidth;

Bad DataMatrix output

I want to create DataMatrix Codes with a fixed length of 15 characters. But there is a formating issue with the following Code using the NuGet v0.16.2:

var dmWriter = new ZXing.BarcodeWriter() { Format = ZXing.BarcodeFormat.DATA_MATRIX };
dmWriter.Options.PureBarcode = true;

//Output OK
var t = dmWriter.Write("0000319%0009367%S");
t.Save("tmp_fine.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

//Output NOK
t = dmWriter.Write("000319%009367%S");
t.Save("tmp_bad.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

When I use 17 characters, everything is OK. With 15 characters, the barcode is displayed blurred. See the attached pictures.

15 Characters:
tmp_bad

17 Characters:
tmp_fine

Zxing.Net issue with few barcode images

Hi,

dg2138ey

Im using Zxing.Net for Bar code detection. Most of the cases its working fine. But for few images im facing an issue when the barcode is rotated. I have attached the sample bar code image for reference.
Im using the zxing library with below options,

this.reader = new BarcodeReader()
{
AutoRotate = true,

            Options = new DecodingOptions()
            {
                TryHarder = true,
                PossibleFormats = new List<BarcodeFormat>
                {
                    BarcodeFormat.EAN_8
                },
            },
            TryInverted = true
        };

Please suggest how can the accuracy can be improved with different rotations of attached images.
Note: I cant stop the rotation as user captures the print out of bar code image.

Zxing on .Net framework 4.3 for gadgeeter

Hi, I'm stuck with a problem i hope u can help me to solve.
I want to use your incredible good library on my FEZ SPIDER using 4.3 version of .net framework but i can't build it! How can I use your lib with this versione of the fw?
Thank you so much

New home?

I know this was a mirror initially of the subversion repo on codeplex, but given codeplex is shutting down, do you plan on making this repo the actual source home?

Love that it's here as I can submodule it now for my library!

CommandLineEncoder options or using the dll directly in VBA

I have a simple VBA app, where I can use the command line to get an QR code image. Everything works great, I just need more options for the commandLineEncoder. I am missing options for ErrorCorrection, ECI, symbolversion etc... , I do not have VisualStudio to fix it myself.

On the other hand, I would use the new ZXing.Net with VBA (COM Interop) but can not do it because I will need to register it on every users computer.

I am already using freeimage.dll which I can simply load with using

Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long

and loading it by

Function FreeImgLoad(ByVal dllFilename As String) As Boolean

    If FreeDLLhm = 0 Then
        ' attempt to load the module
        FreeDLLhm = LoadLibrary(dllFilename)

        If FreeDLLhm > 0 Then
            FreeImgLoad = True
        End If
    End If
End Function

and then using its functions by

Public Declare Function FreeImage_HasPixelsInt Lib "FreeImage.dll" Alias "_FreeImage_HasPixels@4" ( _
                                               ByVal Bitmap As Long) As Long

Is it possible to use the dll for zxing in the same way? Or am I barking up the wrong tree? :)

How to get BW image as output - barcode.write() outputs 24 bit (Format24bppRgb) color image

How can I get a black and white image from barcode.write(). What I get is 24 bit 1.03MB big full color image.

I convert it to 1bpp with this

  var x = ZXing.QrCode.Internal.ErrorCorrectionLevel.H;

           var barcodeWriter = new BarcodeWriter 
            {

                Format = barcodeFormat,
                Options = new ZXing.QrCode.QrCodeEncodingOptions
                {
                    CharacterSet = "ISO-8859-2",
                    Width = 600,
                    Height = 600,
                    ErrorCorrection = x,
                    QrVersion = 15
                }
            };

var bitmap = barcodeWriter.Write("ASDASD");
Console.Out.WriteLine(bitmap.PixelFormat);

var targetBmp = bitmap.Clone(new Rectangle(0, 0, bitmap.Width, bitmap.Height), pixelFormat.Format1bppIndexed);`
Console.Out.WriteLine(targetBmp.PixelFormat);

But barcodewriter first creates 24bit color 1MB big image, and then I convert it to 1 bit per pixel image which is 43Kb. Is there a parameter where I can set QR code to be just black and white? I have to create 2000 QR codes, and this is just too slow... :(

Cannot Decode QRCode

Hello,

I'm having an issue decoding one specific QR code. I have not had any issues with any others that were generated from the same source except this particular one. I have attached the image below. This QR code image is scanned from a piece of paper just FYI. Decode returns null on the result.

Text value should be : 37d59b9d-ad37-11e7-a3da-2e6a680acb2

qrcode

Thanks!
-Kent

Update Nuget Package

Nuget Package is v 0.14.0.1 from 2014. Last commit was in december 2016, is there any reason it cant be updated?

Display text beneath generated barcode

Hi there, I'm trying to generate a barcode (Code_39, 93 or 128) as an SVG inAsp.Net Core but I can't find a way to display the textual value beneath the generated barcode.

As of my understanding, that's what the "PureBarcode" setting is for, but it doesn't seem to change anything setting it explicitely to true/false.

Is there something I'm missing here?

Data Matrix support vague

Hey I found ZXing does not work well with Datamatrix codes.

Also, using the BarcodeReader-Class with Options.PossibleFormats set to DATA_MATRIX does not find Datamatrix-Codes, even PureBarcode ones with a high quality.
However, the DataMatrixReader will find some.

Did I misconfigure something? How come the generic reader does not find them?

Thank you for porting this over to .Net

How can the width get changed?

I'm working on where a barcode will form when a button is pressed but for some reason the width won't change, it stays tiny, this is in Unity 5.5.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using ZXing;
using ZXing.Rendering;

public class Barcode : MonoBehaviour {

	//public float calcPrice;
	public static float price;
	public static string print;
	public static bool error = false;
	private bool show = false;
	public GameObject generateBttn;

	[SerializeField] Button Bcode;

	public Calculator calc;


    // Use this for initialization
    void Awake () {
		calc = GetComponent<Calculator> ();
	}
	
	// Update is called once per frame
	void Update () {
		if (show) {
			generateBttn.GetComponent<Image> ().color = Color.green;
		} else {
			generateBttn.GetComponent<Image> ().color = Color.red;
		}
		if (error) {
			errorMessage ();
		}
		price = Mathf.RoundToInt (calc.chargePrice);
	}

	public void reset(){
		error = false;
	}

	public void setCode(float charge){
		price = Mathf.RoundToInt (calc.chargePrice);
	}

	private static Color32[] Encode (string textForEncoding, int width, int height)
	{
		var writer = new BarcodeWriter {
			Format = BarcodeFormat.CODE_39,
			Options = new ZXing.Common.EncodingOptions 
			{Height = height,Width = width}
		};
			if (price < 0) {
				print =  ("02043541000" + price);
			}
			else if (price < 10 && price >= 0) {
				print =  ("0204354100" + price + "99");
			}
			else if (price < 100 && price >= 10) {
				print =  ("020435410" + price + "99");
			}
			else if (price >= 100 && price < 1000) {
				print =  ("02043541" + price + "99");
			}
			else if (price > 1000) {
				print = 00000.ToString();
				error = true;
				//errorMessage ();
			}
		//}
		return writer.Write (print);
	}

	public void errorMessage(){
		show = false;
		calc.barcodeError ("There has been an error, app is not calibrated to print barcodes over $1,000.00. We appologize for the inconvenience");
		error = false;
	}

	public Texture2D generateCode(string text) {
		var encoded = new Texture2D (256, 300); //256
		var color32 = Encode (text, encoded.width, encoded.height);
		encoded.SetPixels32 (color32);
		encoded.Apply ();
		return encoded;
	}

	public void showBrcode(){
			if (show) {
				show = false;
			} else {
				show = true;
			}
	}

	void OnGUI(){
		if (show && price != 0) {
			Texture2D bbCode = generateCode ("Arrangement");
			if (GUI.Button (new Rect ( Screen.width/2, Screen.height/2, 1000, 500), bbCode, GUIStyle.none)) {
			}
			;
		}
	}
}

"var encoded = new Texture2D (256, 300); //256"
when I change the variables here the only variable that takes effect is the height but the width will stay the same even after changing the variable.
Am I missing something or is there a different way of changing the width?

Barcode Rendering Quality

Although not broken the rendering of SVG QR Codes could be improved by setting the shape-rendering attribute to crispEdges on the generated SVG element to remove anti-aliasing artefacts.

The images below were rendered by Chrome Version 57.0.2987.98 (64-bit) with the results being replicated in Firefox 52.0 (64-bit)

Before:
image

After:
image

Doing the same with 1D barcodes e.g. EAN-13.
Before:
image

After:
image

Unable to use zxing.dll with SSRS 2016

Is there a guide to how to use zxing.dll with SSRS 2016?

I have done all that should be required to use zxing.dll with SSRS but can't get past this error:

[rsRuntimeErrorInExpression] The Value expression for the image ‘Image1’ contains an error: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

The security error is generated when I use the BarCodeWriter.Write method.

This project is really useful and I would like to use it, but I'm stumped.

Thanks. Tim

Code 128 improperly decoded as UPC_E when image is at angle

I have found that a Code 128 barcode image is improperly decoded as UPC_E when the image is at an angle but a second image of the same barcode is properly decoded as Code 128. Note the images below. The angled image returns the incorrect barcode format and value but the approx. 90 degree image works fine.

Correct Code 128 value:
X000WDQ1V3

Improperly decoded value as UPC_E:
00522047

Note that this happens in my own code but also is the same issue in the WindowsFormsDemo application that comes with this distribution. I've tried forcing Code 128 as the only format but then it just fails to decode.

The defaults for the WindowsFormsDemo are checked:
enable Auto Rotate
enable Try Harder
enable Try Inverted
a__3a91

a__2b5b

Support for tilted Barcode

I was using Zxing.net library for a project but unable to detect barcodes tilted at an angle other than multiples of 90 degree.

Building the Unity DLL

How can I rebuild the zxing.unity.dll? So far, I have:

  1. Added the UNITY compiler directive to the .NET 3.5 version of ZXing.NET
  2. Rebuilt the .NET 3.5 project.

At that point, I get errors wherever unity classes/namespaces are used (Color32, UnityEngine, etc).

Thanks,
Eric

Black has Alpha Channel 0

The default definition for Black in NET CORE is new Color(0) which has an alpha channel of 0. This causes the SVG Renderer to render a transparent svg.

I am overriding your defaults such that Foreground = new Color() { A = 255, R = 0, B = 0, G = 0 }
Works perfectly then.

Thanks.

Example code not working correctly.

I'm not quite sure if your example code in the readme file is working in .Net 4.0. But it definitely isn't in .Net 4.5. It should be var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png"); instead of var barcodeBitmap = (Bitmap)Bitmap.LoadFrom("C:\\sample-barcode-image.png");.

So in total:

// create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
   txtDecoderType.Text = result.BarcodeFormat.ToString();
   txtDecoderContent.Text = result.Text;
}

Datamatrix 2d

I'm not able to scan 2d datamatrix codes. Is this a feature that doesn't exist, or an issue with my barcode generator?

Cannot decode data matrix

Hello,

Could anyone give me any insight as to why this cannot be decoded and always returns null? Attached the image and below is my code.

var decoder = new BarcodeReader();
decoder.Options = new ZXing.Common.DecodingOptions() { PureBarcode = true, TryHarder = true, PossibleFormats = new List<BarcodeFormat>() { BarcodeFormat.DATA_MATRIX } };
decoder.AutoRotate = true;
decoder.TryInverted = true;
var results = decoder.Decode(new Bitmap(filename_datamatrix));

datamatrix

Can not use interop zxing after registering

I followed instructions, copied both zxing.dll and zxing.interop.dll to c:\windows and from there with admin rights run register.cmd
It registered, but now in VBA Access, I can not add a reference. It is not listed, and if clicking on browse, and selecting the dll , I get the error - "Can't add a reference to the specified file."

How can I add this to work?

CoreCompat adapter for NET Core 2.0

NET Core 2.0 CoreCompat.System.Drawing adapter should reference package CoreCompat.System.Drawing.v2 otherwise there are type name collisions with netstandard2.0 library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.