當前位置: 首頁>>代碼示例>>C#>>正文


C# XGraphics.DrawMatrixCode方法代碼示例

本文整理匯總了C#中PdfSharp.Drawing.XGraphics.DrawMatrixCode方法的典型用法代碼示例。如果您正苦於以下問題:C# XGraphics.DrawMatrixCode方法的具體用法?C# XGraphics.DrawMatrixCode怎麽用?C# XGraphics.DrawMatrixCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PdfSharp.Drawing.XGraphics的用法示例。


在下文中一共展示了XGraphics.DrawMatrixCode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: RenderPage

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

      XFont font = new XFont("Verdana", 14, XFontStyle.Bold);
      string info = "DataMatrix is a fake in the Open Source version!";
      XSize size = gfx.MeasureString(info, font);
      gfx.DrawString(info, font, XBrushes.Firebrick, (600 - size.Width) / 2, 50);


      //Graphics grfx = gfx.Internals.Graphics;

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

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

      dm = new CodeDataMatrix("test", 16, 48);
      dm.Size = new XSize(XUnit.FromMillimeter(50), XUnit.FromMillimeter(18));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(500, 100));

      dm = new CodeDataMatrix("0123456789", 52);
      dm.Size = new XSize(XUnit.FromMillimeter(30), XUnit.FromMillimeter(30));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(100, 300));

      dm = new CodeDataMatrix("0123456789", 12, 26);
      dm.Direction = CodeDirection.TopToBottom;
      dm.Size = new XSize(XUnit.FromMillimeter(14), XUnit.FromMillimeter(7));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(300, 300));

      dm = new CodeDataMatrix("0123456789", 96);
      dm.Size = new XSize(XUnit.FromMillimeter(30), XUnit.FromMillimeter(30));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(500, 300));

      dm = new CodeDataMatrix("www.empira.de", 20);
      dm.Direction = CodeDirection.BottomToTop;
      dm.Size = new XSize(XUnit.FromMillimeter(7), XUnit.FromMillimeter(7));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(100, 500));

      dm = new CodeDataMatrix("www.empira.de", 144, 144, 2);
      dm.Size = new XSize(XUnit.FromMillimeter(50), XUnit.FromMillimeter(50));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(300, 500));

      dm = new CodeDataMatrix("www.empira.de", 88);
      dm.Direction = CodeDirection.RightToLeft;
      dm.Size = new XSize(XUnit.FromMillimeter(15), XUnit.FromMillimeter(15));
      gfx.DrawMatrixCode(dm, XBrushes.DarkBlue, new XPoint(500, 500));
    }
開發者ID:vronikp,項目名稱:EventRegistration,代碼行數:54,代碼來源:BarCodesDataMatrix.cs


注:本文中的PdfSharp.Drawing.XGraphics.DrawMatrixCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。