本文整理汇总了C#中PdfSharp.Drawing.XMatrix.RotatePrepend方法的典型用法代码示例。如果您正苦于以下问题:C# XMatrix.RotatePrepend方法的具体用法?C# XMatrix.RotatePrepend怎么用?C# XMatrix.RotatePrepend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfSharp.Drawing.XMatrix
的用法示例。
在下文中一共展示了XMatrix.RotatePrepend方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Format
/// <summary>
/// Calculates the space used for the axis title.
/// </summary>
internal override void Format()
{
XGraphics gfx = _rendererParms.Graphics;
AxisTitleRendererInfo atri = ((AxisRendererInfo)_rendererParms.RendererInfo)._axisTitleRendererInfo;
if (atri.AxisTitleText != "")
{
XSize size = gfx.MeasureString(atri.AxisTitleText, atri.AxisTitleFont);
if (atri.AxisTitleOrientation != 0)
{
XPoint[] points = new XPoint[2];
points[0].X = 0;
points[0].Y = 0;
points[1].X = size.Width;
points[1].Y = size.Height;
XMatrix matrix = new XMatrix();
matrix.RotatePrepend(-atri.AxisTitleOrientation);
matrix.TransformPoints(points);
size.Width = Math.Abs(points[1].X - points[0].X);
size.Height = Math.Abs(points[1].Y - points[0].Y);
}
atri.X = 0;
atri.Y = 0;
atri.Height = size.Height;
atri.Width = size.Width;
}
}
示例2: RotateTransform
/// <summary>
/// Applies the specified rotation operation to the transformation matrix of this object
/// in the specified order. The angle unit of measure is degree.
/// </summary>
public void RotateTransform(double angle, XMatrixOrder order)
{
//XMatrix matrix = this.transform;
//matrix.Rotate(angle, order);
//Transform = matrix;
XMatrix matrix = new XMatrix(); //XMatrix.Identity;
matrix.RotatePrepend(angle);
AddTransform(matrix, order);
}
示例3: DrawName
public void DrawName(XGraphics graphics, RectangleF rect, MapOptions options, XFont font, XBrush textBrush, LabelStyle labelStyle)
{
if (graphics == null)
throw new ArgumentNullException("graphics");
RectangleF bounds = TransformedBounds;
if (bounds.IntersectsWith(rect))
{
if (Name != null)
{
string str = Name;
if (labelStyle.Uppercase)
str = str.ToUpperInvariant();
PointF pos = NamePosition;// PointF( bounds.Left + bounds.Width / 2, bounds.Top + bounds.Height / 2 );
using (RenderUtil.SaveState(graphics))
{
XMatrix matrix = new XMatrix();
matrix.TranslatePrepend(pos.X, pos.Y);
matrix.ScalePrepend(1.0f / Astrometrics.ParsecScaleX, 1.0f / Astrometrics.ParsecScaleY);
matrix.RotatePrepend(-labelStyle.Rotation); // Rotate it
graphics.MultiplyTransform(matrix, XMatrixOrder.Prepend);
XSize size = graphics.MeasureString(str, font);
graphics.TranslateTransform(-size.Width / 2, -size.Height / 2); // Center the text
RectangleF textBounds = new RectangleF(0, 0, (float)size.Width, (float)size.Height * 2); // *2 or it gets cut off at high sizes
XTextFormatter tf = new XTextFormatter(graphics);
tf.Alignment = XParagraphAlignment.Center;
tf.DrawString(str, font, textBrush, textBounds);
}
}
}
}
示例4: DrawLabel
public static void DrawLabel(XGraphics g, string text, PointF labelPos, XFont font, XBrush brush, LabelStyle labelStyle)
{
using (RenderUtil.SaveState(g))
{
XTextFormatter tf = new XTextFormatter(g);
tf.Alignment = XParagraphAlignment.Center;
XMatrix matrix = new XMatrix();
matrix.TranslatePrepend(labelPos.X, labelPos.Y);
matrix.ScalePrepend(1.0f / Astrometrics.ParsecScaleX, 1.0f / Astrometrics.ParsecScaleY);
if (labelStyle.Uppercase)
text = text.ToUpper();
if (labelStyle.Wrap)
text = text.Replace(' ', '\n');
matrix.TranslatePrepend(labelStyle.Translation.X, labelStyle.Translation.Y);
matrix.RotatePrepend(labelStyle.Rotation);
matrix.ScalePrepend(labelStyle.Scale.Width, labelStyle.Scale.Height);
g.MultiplyTransform(matrix, XMatrixOrder.Prepend);
XSize size = g.MeasureString(text, font);
size.Width *= 2; // prevent cut-off e.g. when rotated
XRect bounds = new XRect(-size.Width / 2, -size.Height / 2, size.Width, size.Height);
tf.DrawString(text, font, brush, bounds);
}
}