This project has moved. For the latest updates, please go here.

How to change Image Forecolor in zXing WinRT

Aug 30, 2012 at 2:51 PM
Edited Aug 30, 2012 at 2:55 PM

Hello Team,

I have encoded one QRCode using zxing Winrt function as

var writer = new BarcodeWriter { Format = BarcodeFormat.QR_CODE};
imgEncoderBarcode.Source = writer.Write("Encoded By zxing WinRT Library");


I have encoded one QRCode using zxing Winrt function as
Where imgEncoderBarcode is my image control on my xaml page.It will display perfect on screen.
I does not set any property of image control.Here image will display by default with forecolor is blue and backcolor is white.
I need to change Its forecolor to Black.Please check and guide if my implementation is wrong or do I need to set anything else ?

Thanks in advance.

Coordinator
Aug 30, 2012 at 9:03 PM

The default should be black not blue but I made a mistake with the pixel format. I fixed it with revision 81287.

You can change the foreground and background color through a new renderer object:

         var writer = new BarcodeWriter
                         {
                            Renderer = new ZXing.Rendering.WriteableBitmapRenderer {Foreground = Colors.Black}
                         };