本文整理匯總了C#中System.Drawing.Drawing2D.PathGradientBrush.ResetTransform方法的典型用法代碼示例。如果您正苦於以下問題:C# PathGradientBrush.ResetTransform方法的具體用法?C# PathGradientBrush.ResetTransform怎麽用?C# PathGradientBrush.ResetTransform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.Drawing2D.PathGradientBrush
的用法示例。
在下文中一共展示了PathGradientBrush.ResetTransform方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ResetTransform
public void ResetTransform ()
{
using (Matrix m = new Matrix (2, 0, 0, 2, 10, -10)) {
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.Transform = m;
Assert.IsFalse (pgb.Transform.IsIdentity, "Transform.IsIdentity");
pgb.ResetTransform ();
Assert.IsTrue (pgb.Transform.IsIdentity, "Reset.IsIdentity");
}
}
}
示例2: 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");
}
}
示例3: 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);
}
}