Stuart P
Stuart P

Reputation: 79

C# ZXing reader example

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.

Upvotes: 4

Views: 11282

Answers (2)

cpsaez
cpsaez

Reputation: 324

Take a look to my project

http://windowqr.codeplex.com/

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

Upvotes: 1

DuckMaestro
DuckMaestro

Reputation: 15885

I've used the C# port recently. LuminanceSource is an abstract class.

You need to either:

  • subclass LuminanceSource and implement its methods, or
  • utilize the already included RGBLuminanceSource class instead.

I've used the latter to success.

Upvotes: 5

Related Questions