当前位置: 首页>>代码示例>>C#>>正文


C# XGraphics.DrawBarCode方法代码示例

本文整理汇总了C#中PdfSharp.Drawing.XGraphics.DrawBarCode方法的典型用法代码示例。如果您正苦于以下问题:C# XGraphics.DrawBarCode方法的具体用法?C# XGraphics.DrawBarCode怎么用?C# XGraphics.DrawBarCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PdfSharp.Drawing.XGraphics的用法示例。


在下文中一共展示了XGraphics.DrawBarCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderPage

    /// <summary>
    /// Demonstrates the use of barcodes.
    /// </summary>
    public override void RenderPage(XGraphics gfx)
    {
      base.RenderPage(gfx);

      Graphics grfx = gfx.Internals.Graphics;

      Code2of5Interleaved bc25 = new Code2of5Interleaved();
      bc25.Text = "123456";
      bc25.Size = new XSize(90, 30);
      //bc25.Direction = CodeDirection.RightToLeft;
      bc25.TextLocation = TextLocation.Above;
      gfx.DrawBarCode(bc25, XBrushes.DarkBlue, new XPoint(100, 100));

      bc25.Direction = CodeDirection.RightToLeft;
      gfx.DrawBarCode(bc25, XBrushes.DarkBlue, new XPoint(300, 100));

      bc25.Direction = CodeDirection.TopToBottom;
      gfx.DrawBarCode(bc25, XBrushes.DarkBlue, new XPoint(100, 300));

      bc25.Direction = CodeDirection.BottomToTop;
      gfx.DrawBarCode(bc25, XBrushes.Red, new XPoint(300, 300));

      Code3of9Standard bc39 = new Code3of9Standard("ISABEL123", new XSize(90, 40));
      
      bc39.TextLocation = TextLocation.AboveEmbedded;
      gfx.DrawBarCode(bc39, XBrushes.DarkBlue, new XPoint(100, 500));

      bc39.Direction = CodeDirection.RightToLeft;
      gfx.DrawBarCode(bc39, XBrushes.DarkBlue, new XPoint(300, 500));

      bc39.Text = "TITUS";
      bc39.Direction = CodeDirection.TopToBottom;
      gfx.DrawBarCode(bc39, XBrushes.DarkBlue, new XPoint(100, 700));

      bc39.Direction = CodeDirection.BottomToTop;
      gfx.DrawBarCode(bc39, XBrushes.Red, new XPoint(300, 700));

    }
开发者ID:vronikp,项目名称:EventRegistration,代码行数:41,代码来源:BarCodesOrientation.cs

示例2: RenderPage

    /// <summary>
    /// Demonstrates serveral bar code types.
    /// </summary>
    public override void RenderPage(XGraphics gfx)
    {
      XRect rc;
      base.RenderPage(gfx);

      Graphics grfx = gfx.Internals.Graphics;

      Code2of5Interleaved bc25 = new Code2of5Interleaved();
      bc25.Text = "123456";
      bc25.Size = new XSize(90, 30);
      //bc25.Direction = BarCodeDirection.RightToLeft;
      bc25.TextLocation = TextLocation.Above;
      gfx.DrawBarCode(bc25, XBrushes.DarkBlue, new XPoint(100, 100));

      CodeDataMatrix dm = new CodeDataMatrix("test", 26);
      dm.Size = new XSize(XUnit.FromMillimeter(15), XUnit.FromMillimeter(15));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(300, 100));

      rc = new XRect(30, 200, XUnit.FromCentimeter(9.3) + XUnit.FromMillimeter(0.5), XUnit.FromMillimeter(6));
      gfx.DrawRectangle(new XSolidBrush(XColor.FromArgb(128, XColors.LightSeaGreen)), rc);

      CodeOmr omr = new CodeOmr(0xF8F5FF3F.ToString(), rc.Size, CodeDirection.LeftToRight);
      omr.MakerDistance = XUnit.FromMillimeter(3);
      omr.MakerThickness = XUnit.FromMillimeter(0.5);
      gfx.DrawBarCode(omr, XBrushes.Black, rc.Center);

      omr.Direction = CodeDirection.RightToLeft;
      gfx.DrawBarCode(omr, XBrushes.Black, rc.Center + new XSize(0, 50));

      omr.Direction = CodeDirection.RightToLeft;
      gfx.DrawBarCode(omr, XBrushes.Black, rc.Center + new XSize(0, 50));

      omr.Direction = CodeDirection.TopToBottom;
      gfx.DrawBarCode(omr, XBrushes.Black, rc.Center + new XSize(300, 25));
    }
开发者ID:vronikp,项目名称:EventRegistration,代码行数:38,代码来源:BarCodesTypes.cs

示例3: Barcode

        /// <summary>
        /// Draws the voter id as a barcode and a human readable string
        /// </summary>
        /// <param name="gfx">XGraphics object</param>
        /// <param name="votingNumber">The unique voter id </param>
        private void Barcode(XGraphics gfx, string votingNumber)
        {
            //The barcode type
            BarCode barcode = new Code3of9Standard();
            barcode.Text = votingNumber;

            //Indicator to the barcode scanner where the barcode starts and ends
            barcode.StartChar = '*';
            barcode.EndChar = '*';

            //Draws the voter id as a barcode
            barcode.Size = (XSize)(new XPoint(120, 20));
            gfx.DrawBarCode(barcode, XBrushes.Black, new XPoint(310, 40));

            //Draws the voter id as a string
            XFont font = new XFont("Lucida Console", 7, XFontStyle.Regular);
            gfx.DrawString(votingNumber, font, XBrushes.Black, 310, 35);
        }
开发者ID:dirtylion,项目名称:smalltuba,代码行数:23,代码来源:PollingCards.cs


注:本文中的PdfSharp.Drawing.XGraphics.DrawBarCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。