本文整理汇总了C#中PdfSharp.Drawing.XGraphics.WriteComment方法的典型用法代码示例。如果您正苦于以下问题:C# XGraphics.WriteComment方法的具体用法?C# XGraphics.WriteComment怎么用?C# XGraphics.WriteComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfSharp.Drawing.XGraphics
的用法示例。
在下文中一共展示了XGraphics.WriteComment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderPage
public override void RenderPage(XGraphics gfx)
{
base.RenderPage(gfx);
DrawGridlines(gfx);
// Create a new graphical path
XGraphicsPath path = new XGraphicsPath();
XSize size = new XSize(90, 140);
double rotationAngle = 130;
path.AddArc(new XPoint(100, 100), new XPoint(200, 200), size, rotationAngle, false, System.Windows.Media.SweepDirection.Clockwise);
path.StartFigure();
path.AddArc(new XPoint(400, 100), new XPoint(500, 200), size, rotationAngle, false, System.Windows.Media.SweepDirection.Counterclockwise);
path.StartFigure();
path.AddArc(new XPoint(100, 300), new XPoint(200, 400), size, rotationAngle, true, System.Windows.Media.SweepDirection.Clockwise);
path.StartFigure();
path.AddArc(new XPoint(400, 300), new XPoint(500, 400), size, rotationAngle, true, System.Windows.Media.SweepDirection.Counterclockwise);
path.StartFigure();
#if DEBUG_
gfx.WriteComment("PathArcSegment");
#endif
gfx.DrawPath(XPens.Red, path);
}
示例2: RenderPage
/// <summary>
/// Demonstrates the use of XGraphics.DrawRoundedRectangle.
/// </summary>
public override void RenderPage(XGraphics gfx)
{
base.RenderPage(gfx);
#if DEBUG
gfx.WriteComment("begin DrawRoundedRectangle");
#endif
// Stroke rounded rectangle
gfx.DrawRoundedRectangle(properties.Pen1.Pen, 50, 100, 450, 150, 50, 30);
#if DEBUG
gfx.WriteComment("end DrawRoundedRectangle");
#endif
// Fill rounded rectangle
gfx.DrawRoundedRectangle(properties.Brush2.Brush, new Rectangle(50, 300, 450, 150), new SizeF(30, 20));
// Stroke and fill rounded rectangle
gfx.DrawRoundedRectangle(properties.Pen2.Pen, properties.Brush2.Brush,
new XRect(50, 500, 450, 150), new XSize(75, 75));
}
示例3: RenderPage
public override void RenderPage(XGraphics gfx)
{
//base.RenderPage(gfx);
XFont font1 = new XFont("Times New Roman", 12);
XFont font2 = new XFont("Courier New", 10, XFontStyle.Bold);
gfx.WriteComment("Word 11");
gfx.DrawString("Word 11", font1, XBrushes.Black, new XPoint(50, 100));
gfx.WriteComment("Word 12");
gfx.DrawString("Word 12", font1, XBrushes.Black, new XPoint(100, 100));
gfx.WriteComment("Word 21");
gfx.DrawString("Word 21", font2, XBrushes.Black, new XPoint(50, 200));
gfx.WriteComment("Word 22");
gfx.DrawString("Word 22", font2, XBrushes.Black, new XPoint(100, 200));
gfx.WriteComment("Word 23");
gfx.DrawString("Word 22", font2, XBrushes.Red, new XPoint(150, 200));
gfx.WriteComment("Word 24");
gfx.DrawString("Word 24", font2, XBrushes.Red, new XPoint(200, 200));
}
示例4: RenderPage
public override void RenderPage(XGraphics gfx)
{
base.RenderPage(gfx);
// Create a new graphical path
XGraphicsPath path = new XGraphicsPath();
// Add the outline of the glyphs of the word 'Clip' to the path
path.AddString("Clip!", new XFontFamily("Times New Roman"), XFontStyle.BoldItalic, 250, new XPoint(30, 100), XStringFormats.Default);
#if DEBUG_
gfx.WriteComment("SetClip");
#endif
// Set the path as clip path
gfx.IntersectClip(path);
#if DEBUG_
gfx.WriteComment("Random lines");
#endif
// Draw some random lines to show that clipping happens
Random rnd = new Random(42);
for (int idx = 0; idx < 300; idx++)
gfx.DrawLine(properties.Pen2.Pen, rnd.Next(600), rnd.Next(500), rnd.Next(600), rnd.Next(500));
}