本文整理汇总了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));
}
示例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));
}