首先条码打印机和扫描枪都是没有问题的,用条码打印机自带的软件做的条码都能扫描,自己生成的却不的行,我换了其它格式的也不行,help一下!!        private System.Drawing.Printing.PrintDocument printDocument1;
        private void Form1_Load(object sender, EventArgs e)
        {
            axBarCodeCtrl1.Value = "BM1159999";            printDocument1 = new System.Drawing.Printing.PrintDocument();
            printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(printDocument1_PrintPage);
        }
        
        Bitmap memorybitmap;
        /// <summary>
        /// 导出条码为bmp
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Graphics g = axBarCodeCtrl1.CreateGraphics();
                memorybitmap = new Bitmap(axBarCodeCtrl1.Size.Width, axBarCodeCtrl1.Size.Height, g);
                g = Graphics.FromImage(memorybitmap);
                g.CopyFromScreen(this.Location.X + axBarCodeCtrl1.Location.X, this.Location.Y + axBarCodeCtrl1.Location.Y + SystemInformation.CaptionHeight, 0, 0, this.Size);
                memorybitmap.Save(@"d:\Barcode\b.bmp");//保存为图片                    
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawImage(printBmp, new Point(0, 0));
        }        Bitmap printBmp;
        /// <summary>
        /// 打印条码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                Graphics g = axBarCodeCtrl1.CreateGraphics();
                printBmp = new Bitmap(axBarCodeCtrl1.Size.Width, axBarCodeCtrl1.Size.Height, g);
                g = Graphics.FromImage(printBmp);
                g.CopyFromScreen(this.Location.X + axBarCodeCtrl1.Location.X, this.Location.Y + axBarCodeCtrl1.Location.Y + SystemInformation.CaptionHeight, 0, 0, this.Size);                printDocument1.Print();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }        }