コード例 #1
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="g"></param>
            /// <param name="codeInfo"></param>
            public void DrawBarCode(Graphics g, RptBarCode codeInfo)
            {
                BarcodeLib.Barcode bar = new BarcodeLib.Barcode();
                bar.IncludeLabel = codeInfo.ShowFooter;

                try {
                    var barCode = bar.Encode(ShareLib.Convert(codeInfo.CodeType), codeInfo.BarCode, (int)codeInfo.Rect.Width, codeInfo.InnerRect.Height - 2);
                    g.DrawImage(barCode, new Point((int)codeInfo.LeftMargin - 3, (int)codeInfo.TopMargin - 1));
                }
                catch { }
            }
コード例 #2
0
 public void DrawBarCodeWithLib(DevExpress.XtraPrinting.BrickGraphics g, RptBarCode codeInfo, string barCode, Rectangle realDrawRect)
 {
     BarcodeLib.Barcode bar = new BarcodeLib.Barcode();
     //bar.BackColor = Color.White;\
     bar.ImageFormat  = ImageFormat.Gif;
     bar.IncludeLabel = codeInfo.ShowFooter;
     try {
         var rect = new RectangleF(realDrawRect.X, realDrawRect.Y + 1, realDrawRect.Width, realDrawRect.Height - 1);
         g.DrawImage(bar.Encode(ShareLib.Convert(codeInfo.CodeType), barCode, (int)rect.Width, (int)rect.Height),
                     rect, DevExpress.XtraPrinting.BorderSide.None, Color.White);
     }
     catch { }
 }