public Image RenderImage() { BarcodeLib.Barcode b = new BarcodeLib.Barcode(Contents, BarcodeLib.TYPE.CODE128); b.ForeColor = System.Drawing.Color.Black; b.BackColor = System.Drawing.Color.White; b.Width = (int)Math.Ceiling(Width.ConvertTo(QuantityTypes.Length.Inch) * 96); //96 DPI b.Height = (int)Math.Ceiling(Height.ConvertTo(QuantityTypes.Length.Inch) * 96); //96 DPI b.IncludeLabel = true; return(b.Encode(BarcodeLib.TYPE.CODE128, Contents)); }
public Size ConvertToPixels() => new Size(Width.ConvertTo(Unit.Parse("PixelX")), Height.ConvertTo(Unit.Parse("PixelY")));
public Size ConvertTo(Unit unit) => new Size(Width.ConvertTo(unit), Height.ConvertTo(unit));