本文整理汇总了C#中PdfSharp.Drawing.XGraphics.EndContainer方法的典型用法代码示例。如果您正苦于以下问题:C# XGraphics.EndContainer方法的具体用法?C# XGraphics.EndContainer怎么用?C# XGraphics.EndContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfSharp.Drawing.XGraphics
的用法示例。
在下文中一共展示了XGraphics.EndContainer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderPage
public override void RenderPage(XGraphics gfx)
{
base.RenderPage(gfx);
PointF[] origins = new PointF[]
{
new PointF(100, 200), new PointF(300, 200),
new PointF(100, 400), new PointF(300, 400),
new PointF(100, 600), new PointF(350, 600),
};
PointF origin;
XGraphicsContainer container;
float length = 100;
// Not transformed
origin = origins[0];
DrawAxes(gfx, XPens.Black, origin, length);
gfx.DrawString(this.properties.Font2.Text, this.properties.Font2.Font, this.properties.Font2.Brush, origin);
// Translation
container = gfx.BeginContainer(new RectangleF(10, 10, 1, 1), new RectangleF(0, 0, 1, 1), XGraphicsUnit.Point);
origin = origins[1];
DrawAxes(gfx, XPens.Black, origin, length);
gfx.TranslateTransform(20, -30);
DrawAxes(gfx, XPens.DarkGray, origin, length);
gfx.DrawString(this.properties.Font2.Text, this.properties.Font2.Font, this.properties.Font2.Brush, origin);
gfx.EndContainer(container);
// Scaling
container = gfx.BeginContainer(new RectangleF(0, 0, 1, 1), new RectangleF(0, 0, 1, 1), XGraphicsUnit.Point);
origin = origins[2];
DrawAxes(gfx, XPens.Black, origin, length);
gfx.TranslateTransform(origin.X, origin.Y);
gfx.ScaleTransform(1.3f, 1.5f);
DrawAxes(gfx, XPens.DarkGray, new PointF(), length);
gfx.DrawString(this.properties.Font2.Text, this.properties.Font2.Font, this.properties.Font2.Brush, 0, 0);
gfx.EndContainer(container);
// Rotation
container = gfx.BeginContainer(new RectangleF(0, 0, 1, 1), new RectangleF(0, 0, 1, 1), XGraphicsUnit.Point);
origin = origins[3];
DrawAxes(gfx, XPens.Black, origin, length);
gfx.TranslateTransform(origin.X, origin.Y);
gfx.RotateTransform(-45);
DrawAxes(gfx, XPens.DarkGray, new PointF(), length);
gfx.DrawString(this.properties.Font2.Text, this.properties.Font2.Font, this.properties.Font2.Brush, 0 , 0);
gfx.EndContainer(container);
// Skewing (or shearing)
container = gfx.BeginContainer(new RectangleF(0, 0, 1, 1), new RectangleF(0, 0, 1, 1), XGraphicsUnit.Point);
origin = origins[4];
DrawAxes(gfx, XPens.Black, origin, length);
gfx.TranslateTransform(origin.X, origin.Y);
gfx.MultiplyTransform(new Matrix(1, -0.3f, -0.4f, 1, 0, 0));
DrawAxes(gfx, XPens.DarkGray, new PointF(), length);
gfx.DrawString(this.properties.Font2.Text, this.properties.Font2.Font, this.properties.Font2.Brush, 0 , 0);
gfx.EndContainer(container);
// Reflection
container = gfx.BeginContainer(new RectangleF(0, 0, 1, 1), new RectangleF(0, 0, 1, 1), XGraphicsUnit.Point);
origin = origins[5];
DrawAxes(gfx, XPens.Black, origin, length);
gfx.TranslateTransform(origin.X, origin.Y);
gfx.MultiplyTransform(new Matrix(-1, 0, 0, -1, 0, 0));
DrawAxes(gfx, XPens.DarkGray, new PointF(), length);
gfx.DrawString(this.properties.Font2.Text, this.properties.Font2.Font, this.properties.Font2.Brush, 0 , 0);
gfx.EndContainer(container);
}