當前位置: 首頁>>代碼示例>>C#>>正文


C# PathGradientBrush.ScaleTransform方法代碼示例

本文整理匯總了C#中System.Drawing.Drawing2D.PathGradientBrush.ScaleTransform方法的典型用法代碼示例。如果您正苦於以下問題:C# PathGradientBrush.ScaleTransform方法的具體用法?C# PathGradientBrush.ScaleTransform怎麽用?C# PathGradientBrush.ScaleTransform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.Drawing2D.PathGradientBrush的用法示例。


在下文中一共展示了PathGradientBrush.ScaleTransform方法的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");
			}
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:43,代碼來源:PathGradientBrushTest.cs

示例2: ScaleTransform_InvalidOrder

		public void ScaleTransform_InvalidOrder ()
		{
			using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
				pgb.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue);
			}
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:6,代碼來源:PathGradientBrushTest.cs

示例3: ScaleTransform

		public void ScaleTransform ()
		{
			using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
				pgb.ScaleTransform (2, 4);
				float[] elements = pgb.Transform.Elements;
				Assert.AreEqual (2, elements[0], 0.1, "matrix.0");
				Assert.AreEqual (0, elements[1], 0.1, "matrix.1");
				Assert.AreEqual (0, elements[2], 0.1, "matrix.2");
				Assert.AreEqual (4, 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.ScaleTransform (0.5f, 0.25f);
				Assert.IsTrue (pgb.Transform.IsIdentity, "Transform.IsIdentity");
			}
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:16,代碼來源:PathGradientBrushTest.cs

示例4: ScaleTransform_MaxMin

		public void ScaleTransform_MaxMin ()
		{
			using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
				pgb.ScaleTransform (Single.MaxValue, Single.MinValue);
				float[] elements = pgb.Transform.Elements;
				Assert.AreEqual (Single.MaxValue, elements[0], 1e33, "matrix.0");
				Assert.AreEqual (0, elements[1], 0.1, "matrix.1");
				Assert.AreEqual (0, elements[2], 0.1, "matrix.2");
				Assert.AreEqual (Single.MinValue, elements[3], 1e33, "matrix.3");
				Assert.AreEqual (0, elements[4], 0.1, "matrix.4");
				Assert.AreEqual (0, elements[5], 0.1, "matrix.5");
			}
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:13,代碼來源:PathGradientBrushTest.cs

示例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);
			}
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:21,代碼來源:PathGradientBrushTest.cs


注:本文中的System.Drawing.Drawing2D.PathGradientBrush.ScaleTransform方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。