Showing posts with label Zxing .net hide text in 128 code. Show all posts
Showing posts with label Zxing .net hide text in 128 code. Show all posts

Wednesday, October 10, 2012

How to hide user readable text in code 128?


public class PureBarcodeRenderer : ZXing.Rendering.BitmapRenderer
{
   public override Bitmap Render(BitMatrix matrix, BarcodeFormat format, string content, EncodingOptions options)
   {
      return base.Render(matrix, format, null, options);
   }
}

var writer = new BarcodeWriter
                {
                   Renderer = new PureBarcodeRenderer(),
                   Format = BarcodeFormat.CODE_128,
                   Options = new EncodingOptions
                                  {
                                     Height = 100,
                                     Width = 300
                                  }
                            };
var image = writer.Write(content);