Ejemplo n.º 1
0
        public void initBarcode(string barcode, string discription, string itemcode)
        {
            this._BarcodeInfo.Barcode     = barcode;
            this._BarcodeInfo.Description = this.DiscriptionSummary;
            Code128Content content = new Code128Content(this._BarcodeInfo.Barcode);

            int[] codes = content.Codes;
            this._BarcodeRenterInfo.Patterns = Code128Rendering.CreatePatterns(codes);
            foreach (int x in this._BarcodeRenterInfo.Patterns)
            {
                Console.WriteLine(x.ToString());
            }
            this._BarcodeRenterInfo.BarColor        = Color.Black;
            this._BarcodeRenterInfo.ShowBarcodeText = true;
            this._BarcodeRenterInfo.ShowDescription = true;
            try
            {
                this._BarcodeRenterInfo.TextFont = new Font(SystemFonts.DefaultFont.FontFamily,
                                                            (float)BarcodePrinter.Properties.Settings.Default.FontSize, FontStyle.Regular);
            }
            catch (Exception)
            { }

            this._BarcodeRenterInfo.SetMarginAll(4);
            this._BarcodeRenterInfo.QuitZone = new System.Drawing.Printing.Margins(2, 2, 2, 2);
        }