本文整理汇总了C#中Point2D.TransformBy方法的典型用法代码示例。如果您正苦于以下问题:C# Point2D.TransformBy方法的具体用法?C# Point2D.TransformBy怎么用?C# Point2D.TransformBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2D
的用法示例。
在下文中一共展示了Point2D.TransformBy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetExtents
public override Extents GetExtents()
{
float offset = Math.Sign(Offset) * (0.5f * TextHeight + Math.Abs(Offset));
Vector2D dir = P2 - P1;
float angle = dir.Angle;
float len = dir.Length;
Point2D p1 = new Point2D(0, 0);
Point2D p2 = new Point2D(len, 0);
Point2D p3 = p1 + new Vector2D(0, offset);
Point2D p4 = p2 + new Vector2D(0, offset);
Matrix2D trans = Matrix2D.Transformation(1, 1, angle, P1.X, P1.Y);
p1.TransformBy(trans);
p2.TransformBy(trans);
p3.TransformBy(trans);
p4.TransformBy(trans);
Extents extents = new Extents();
extents.Add(p1);
extents.Add(p2);
extents.Add(p3);
extents.Add(p4);
return extents;
}
示例2: GetExtents
public override Extents GetExtents()
{
float thHeight = Height * Lines.Length * 1.425f;
float thWidth = 0;
foreach (string line in Lines)
{
thWidth = Math.Max(thWidth, line.Length * Height / 2);
}
float angle = Rotation / 180 * (float)Math.PI;
Point2D p1 = new Point2D(0, 0);
Point2D p2 = new Point2D(thWidth, 0);
Point2D p3 = new Point2D(0, -thHeight);
Point2D p4 = new Point2D(thWidth, -thHeight);
Matrix2D trans = Matrix2D.Transformation(1, 1, angle, P.X, P.Y);
p1.TransformBy(trans);
p2.TransformBy(trans);
p3.TransformBy(trans);
p4.TransformBy(trans);
Extents extents = new Extents();
extents.Add(p1);
extents.Add(p2);
extents.Add(p3);
extents.Add(p4);
return extents;
}
示例3: GetExtents
public override Extents GetExtents()
{
float angle = Rotation / 180 * (float)Math.PI;
float thHeight = Height;
float thWidth = String.Length * thHeight / 2;
Point2D p1 = new Point2D(0, 0);
Point2D p2 = new Point2D(thWidth, 0);
Point2D p3 = new Point2D(0, thHeight);
Point2D p4 = new Point2D(thWidth, thHeight);
float dx = 0;
float dy = 0;
if (HorizontalAlignment == StringAlignment.Far)
dx = -thWidth;
else if (HorizontalAlignment == StringAlignment.Center)
dx = -thWidth / 2;
if (VerticalAlignment == StringAlignment.Far)
dy = -thHeight;
else if (VerticalAlignment == StringAlignment.Center)
dy = -thHeight / 2;
Vector2D offset = new Vector2D(dx, dy);
p1 = p1 + offset;
p2 = p2 + offset;
p3 = p3 + offset;
p4 = p4 + offset;
Matrix2D trans = Matrix2D.Transformation(1, 1, angle, P.X, P.Y);
p1.TransformBy(trans);
p2.TransformBy(trans);
p3.TransformBy(trans);
p4.TransformBy(trans);
Extents extents = new Extents();
extents.Add(p1);
extents.Add(p2);
extents.Add(p3);
extents.Add(p4);
return extents;
}