本文整理汇总了C#中System.Drawing.Drawing2D.PathGradientBrush.RotateTransform方法的典型用法代码示例。如果您正苦于以下问题:C# PathGradientBrush.RotateTransform方法的具体用法?C# PathGradientBrush.RotateTransform怎么用?C# PathGradientBrush.RotateTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Drawing2D.PathGradientBrush
的用法示例。
在下文中一共展示了PathGradientBrush.RotateTransform方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Transform_Operations
public void Transform_Operations ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
Matrix clone = pgb.Transform.Clone ();
Matrix mul = clone.Clone ();
clone.Multiply (mul, MatrixOrder.Append);
pgb.MultiplyTransform (mul, MatrixOrder.Append);
Assert.AreEqual (pgb.Transform, clone, "Multiply/Append");
clone.Multiply (mul, MatrixOrder.Prepend);
pgb.MultiplyTransform (mul, MatrixOrder.Prepend);
Assert.AreEqual (pgb.Transform, clone, "Multiply/Prepend");
clone.Rotate (45, MatrixOrder.Append);
pgb.RotateTransform (45, MatrixOrder.Append);
Assert.AreEqual (pgb.Transform, clone, "Rotate/Append");
clone.Rotate (45, MatrixOrder.Prepend);
pgb.RotateTransform (45, MatrixOrder.Prepend);
Assert.AreEqual (pgb.Transform, clone, "Rotate/Prepend");
clone.Scale (0.25f, 2, MatrixOrder.Append);
pgb.ScaleTransform (0.25f, 2, MatrixOrder.Append);
Assert.AreEqual (pgb.Transform, clone, "Scale/Append");
clone.Scale (0.25f, 2, MatrixOrder.Prepend);
pgb.ScaleTransform (0.25f, 2, MatrixOrder.Prepend);
Assert.AreEqual (pgb.Transform, clone, "Scale/Prepend");
clone.Translate (10, 20, MatrixOrder.Append);
pgb.TranslateTransform (10, 20, MatrixOrder.Append);
Assert.AreEqual (pgb.Transform, clone, "Translate/Append");
clone.Translate (30, 40, MatrixOrder.Prepend);
pgb.TranslateTransform (30, 40, MatrixOrder.Prepend);
Assert.AreEqual (pgb.Transform, clone, "Translate/Prepend");
clone.Reset ();
pgb.ResetTransform ();
Assert.AreEqual (pgb.Transform, clone, "Reset");
}
}
示例2: RotateTransform_InvalidOrder
public void RotateTransform_InvalidOrder ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.RotateTransform (720, (MatrixOrder) Int32.MinValue);
}
}
示例3: RotateTransform
public void RotateTransform ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.RotateTransform (90);
float[] elements = pgb.Transform.Elements;
Assert.AreEqual (0, elements[0], 0.1, "matrix.0");
Assert.AreEqual (1, elements[1], 0.1, "matrix.1");
Assert.AreEqual (-1, elements[2], 0.1, "matrix.2");
Assert.AreEqual (0, elements[3], 0.1, "matrix.3");
Assert.AreEqual (0, elements[4], 0.1, "matrix.4");
Assert.AreEqual (0, elements[5], 0.1, "matrix.5");
pgb.RotateTransform (270);
Assert.IsTrue (pgb.Transform.IsIdentity, "Transform.IsIdentity");
}
}
示例4: RotateTransform_Min
public void RotateTransform_Min ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.RotateTransform (Single.MinValue);
float[] elements = pgb.Transform.Elements;
Assert.AreEqual (-5.93904E+36, elements[0], 1e32, "matrix.0");
Assert.AreEqual (-5.93904E+36, elements[1], 1e32, "matrix.1");
Assert.AreEqual (5.93904E+36, elements[2], 1e32, "matrix.2");
Assert.AreEqual (-5.93904E+36, elements[3], 1e32, "matrix.3");
Assert.AreEqual (0, elements[4], 0.1, "matrix.4");
Assert.AreEqual (0, elements[5], 0.1, "matrix.5");
}
}
示例5: Rectangle
public void Rectangle ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.TileFlipXY)) {
CheckDefaultRectangle ("Original", pgb.Rectangle);
pgb.MultiplyTransform (new Matrix (2, 0, 0, 2, 2, 2));
CheckDefaultRectangle ("Multiply", pgb.Rectangle);
pgb.ResetTransform ();
CheckDefaultRectangle ("Reset", pgb.Rectangle);
pgb.RotateTransform (90);
CheckDefaultRectangle ("Rotate", pgb.Rectangle);
pgb.ScaleTransform (4, 0.25f);
CheckDefaultRectangle ("Scale", pgb.Rectangle);
pgb.TranslateTransform (-10, -20);
CheckDefaultRectangle ("Translate", pgb.Rectangle);
pgb.SetBlendTriangularShape (0.5f);
CheckDefaultRectangle ("SetBlendTriangularShape", pgb.Rectangle);
pgb.SetSigmaBellShape (0.5f);
CheckDefaultRectangle ("SetSigmaBellShape", pgb.Rectangle);
}
}