本文整理汇总了C#中PdfSharp.Drawing.XMatrix.Prepend方法的典型用法代码示例。如果您正苦于以下问题:C# XMatrix.Prepend方法的具体用法?C# XMatrix.Prepend怎么用?C# XMatrix.Prepend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfSharp.Drawing.XMatrix
的用法示例。
在下文中一共展示了XMatrix.Prepend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultiplyTransform
/// <summary>
/// Multiplies the transformation matrix of this object and specified matrix in the specified order.
/// </summary>
public void MultiplyTransform(XMatrix matrix, XMatrixOrder order)
{
//XMatrix matrix2 = this.transform;
//matrix2.Multiply(matrix, order);
//Transform = matrix2;
XMatrix matrix2 = new XMatrix(); //XMatrix.Identity;
matrix2.Prepend(matrix);
AddTransform(matrix2, order);
}
示例2: Initialize
/// <summary>
/// Internal setup.
/// </summary>
void Initialize()
{
this.pageOrigin = new XPoint();
XMatrix matrix = new XMatrix(); //XMatrix.Identity;
double pageHeight = this.pageSize.height;
PdfPage targetPage = PdfPage;
XPoint trimOffset = new XPoint();
if (targetPage != null && targetPage.TrimMargins.AreSet)
{
pageHeight += targetPage.TrimMargins.Top.Point + targetPage.TrimMargins.Bottom.Point;
trimOffset = new XPoint(targetPage.TrimMargins.Left.Point, targetPage.TrimMargins.Top.Point);
}
#if GDI
if (this.targetContext == XGraphicTargetContext.GDI)
{
if (this.gfx != null)
matrix = (XMatrix)gfx.Transform;
if (this.pageUnit != XGraphicsUnit.Point)
{
switch (this.pageUnit)
{
case XGraphicsUnit.Inch:
matrix.ScalePrepend(XUnit.InchFactor);
break;
case XGraphicsUnit.Millimeter:
matrix.ScalePrepend(XUnit.MillimeterFactor);
break;
case XGraphicsUnit.Centimeter:
matrix.ScalePrepend(XUnit.CentimeterFactor);
break;
case XGraphicsUnit.Presentation:
matrix.ScalePrepend(XUnit.PresentationFactor);
break;
}
}
}
#endif
#if WPF
if (this.targetContext == XGraphicTargetContext.WPF)
{
if (this.pageUnit != XGraphicsUnit.Presentation)
{
switch (this.pageUnit)
{
case XGraphicsUnit.Point:
matrix.ScalePrepend(XUnit.PointFactorWpf);
break;
case XGraphicsUnit.Inch:
matrix.ScalePrepend(XUnit.InchFactorWpf);
break;
case XGraphicsUnit.Millimeter:
matrix.ScalePrepend(XUnit.MillimeterFactorWpf);
break;
case XGraphicsUnit.Centimeter:
matrix.ScalePrepend(XUnit.CentimeterFactorWpf);
break;
}
if (!matrix.IsIdentity)
{
#if !SILVERLIGHT
MatrixTransform transform = new MatrixTransform((System.Windows.Media.Matrix)matrix);
dc.PushTransform(transform);
#else
MatrixTransform transform2 = new MatrixTransform();
transform2.Matrix = (System.Windows.Media.Matrix)matrix;
dc.PushTransform(transform2);
#endif
}
}
}
#endif
if (this.pageDirection == XPageDirection.Upwards)
matrix.Prepend(new XMatrix(1, 0, 0, -1, 0, pageHeight));
if (trimOffset != new XPoint())
matrix.TranslatePrepend(trimOffset.x, trimOffset.y);
this.defaultViewMatrix = matrix;
this.transform = new XMatrix(); //XMatrix.Identity;
}