Ejemplo de lector de C # ZXing

Has anyone had success using a recent version of ZXing under C#?

I'm attempting to use ZXing to process images I'm pulling in from the webcam, ideally in "real"time, but all the examples I can find for using ZXing to decode appear to be outdated. Starting to go a little nuts.

As far as I can tell, if I can get my cam image to be a BinaryBitmap I'll be fine, but none of the methods/classes used for converting in the examples I can find seem to exist anymore.

Here's the code currently causing me a headache:

Binarizer barney = new HybridBinarizer(new LuminanceSource(image));
Result result = reader.decode(new BinaryBitmap(barney));

LuminanceSource seems to be my speed bump right now. I can't find the appropriate class to instantiate under C#, BufferedLuminance and AWTImageLuminanceSource don't seem to exist under C#.

Anyone able to point out what I should be doing...?

I'm running Win7 64b, ZXing 1.7, VS2008.

preguntado el 31 de enero de 12 a las 08:01

Did you check the other questions on this topic here at Stack Overflow? -

I have taken a look at the other ZXing. As far as I can see they all either use an older version of ZXing which supports BufferedLuminance or AWT or they don't show the code for capturing the image into the reader. Will take another browse to be sure... -

2 Respuestas

I've used the C# port recently. LuminanceSource es una clase abstracta.


  • Subclase LuminanceSource and implement its methods, or
  • utilize the already included RGBLuminanceSource clase en su lugar.

I've used the latter to success.

Respondido el 31 de enero de 12 a las 12:01

Thanks. Stumbled upon RGBLuminanceSource in this thread: stackoverflow.com/questions/4672246/zxing-in-c-sharp-using-ikvm Snd was just about to update when I saw your reply. Cheers. - Stuart P

Take a look to my project


It can scan qr codes from a webcam and it uses zxing from the qr decodification.

Respondido 18 Abr '12, 17:04

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.