public PixelTextDataRenderer(string foregroundColor, string backgroundColor, string displayText) { _displayText = displayText; _dataRenderer = new PixelDataRenderer() { Background = new PixelDataRenderer.Color((string.IsNullOrEmpty(backgroundColor) ? Color.White : Color.FromName(backgroundColor)).ToArgb()), Foreground = new PixelDataRenderer.Color((string.IsNullOrEmpty(foregroundColor) ? Color.Black : Color.FromName(foregroundColor)).ToArgb()) }; }
public static Bitmap ToBitmap(BitMatrix bitMatrix, int Margin = 0) { PixelDataRenderer renderer = new PixelDataRenderer(); var options = new EncodingOptions() { Margin = Margin }; var pixelData = renderer.Render(bitMatrix, BarcodeFormat.QR_CODE, null, options); return(ToBitmap(pixelData)); }
/// <summary> /// Initializes a new instance of the <see cref="BarcodeWriterPixelData"/> class. /// </summary> public BarcodeWriterPixelData() { Renderer = new PixelDataRenderer(); }
public PixelData ToBitmap(BarcodeFormat format, String content) { var renderer = new PixelDataRenderer(); return(renderer.Render(this, format, content)); }
public PixelData ToBitmap() { var renderer = new PixelDataRenderer(); return(renderer.Render(this, BarcodeFormat.EAN_8, string.Empty)); }