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);

No comments:

Post a Comment