Пример #1
0
        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));
        }
Пример #2
0
 public Size ConvertToPixels() => new Size(Width.ConvertTo(Unit.Parse("PixelX")), Height.ConvertTo(Unit.Parse("PixelY")));
Пример #3
0
 public Size ConvertTo(Unit unit) => new Size(Width.ConvertTo(unit), Height.ConvertTo(unit));