Exemplo n.º 1
0
        private void GenerateBarCode(string labNo)
        {
            Code128BarcodeDraw zbc = BarcodeDrawFactory.Code128WithChecksum;

            System.Drawing.Image   img2 = zbc.Draw(labNo, 20, 1);
            System.IO.MemoryStream ms2  = new System.IO.MemoryStream();
            img2.Save(ms2, System.Drawing.Imaging.ImageFormat.Png);
            System.Windows.Forms.PictureBox pb = new PictureBox();
            pb.Image = img2;
            pb.Image.Save(Application.StartupPath + "\\Barcode\\" + labNo.Replace("/", "").Replace("\\", "") + ".png");
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Code128BarcodeDraw barcode = BarcodeDrawFactory.Code128WithChecksum;

            pictureBox1.Image = barcode.Draw(textBox1.Text, 80);
        }