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


C# Region.Equals方法代碼示例

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


在下文中一共展示了Region.Equals方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ClipTest_2

		public void ClipTest_2() {
			Region r = new Region(new Rectangle(10, 10, 60, 60));
			t.Graphics.Clip = r;
			Assert.IsTrue(r.Equals(t.Graphics.Clip, t.Graphics));

			Pen redPen   = new Pen(Color.Red, 3);
			Pen greenPen = new Pen(Color.Green, 3);
			// Create points that define curve.
			Point point1 = new Point( 50,  50);
			Point point2 = new Point(100,  25);
			Point point3 = new Point(200,   5);
			Point point4 = new Point(250,  50);
			Point point5 = new Point(300, 100);
			Point point6 = new Point(350, 200);
			Point point7 = new Point(250, 250);
			Point[] curvePoints = {
									  point1,
									  point2,
									  point3,
									  point4,
									  point5,
									  point6,
									  point7
								  };
			// Draw lines between original points to screen.
			t.Graphics.DrawLines(redPen, curvePoints);
			t.Show ();
			Assert.IsTrue(t.PDCompare(TOLERANCE));
		}
開發者ID:kumpera,項目名稱:mono,代碼行數:29,代碼來源:Graphics.cs

示例2: IsEqual

		public void IsEqual ()
		{
			Region r1 = new Region (sp1);
			Region r2 = new Region (sp2);
			Region r3 = new Region (sp3);
			Region r4 = new Region (sp4);
			// with self
			Assert.IsTrue (r1.Equals (r1, graphic), "r1-r1");
			Assert.IsTrue (r2.Equals (r2, graphic), "r2-r2");
			Assert.IsTrue (r3.Equals (r3, graphic), "r3-r3");
			Assert.IsTrue (r4.Equals (r4, graphic), "r4-r4");
			// with a different
			Assert.IsFalse (r1.Equals (r4, graphic), "r1-r4");
			Assert.IsFalse (r2.Equals (r3, graphic), "r2-r3");
			Assert.IsFalse (r3.Equals (r2, graphic), "r3-r2");
			Assert.IsFalse (r4.Equals (r1, graphic), "r4-r1");
			// with same (not self)
			Region r5 = r1.Clone ();
			r1.Exclude (r4);
			Assert.IsTrue (r1.Equals (r5, graphic), "r1-r5");
			Assert.IsTrue (r5.Equals (r1, graphic), "r5-r1");
			Assert.IsFalse (r5.Equals (r4, graphic), "r5-r4");
			Assert.IsFalse (r4.Equals (r5, graphic), "r4-r5");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:24,代碼來源:RegionNonRectTest.cs

示例3: ClipTest_1

		public void ClipTest_1() {
			Region r = new Region();
			Assert.IsTrue(r.Equals(t.Graphics.Clip, t.Graphics));
		}
開發者ID:kumpera,項目名稱:mono,代碼行數:4,代碼來源:Graphics.cs

示例4: ClipTest_1

		public void ClipTest_1() {
			Region r = new Region();
			Assert.That(r.Equals(t.Graphics.Clip, t.Graphics), Is.True);
		}
開發者ID:sushihangover,項目名稱:playscript,代碼行數:4,代碼來源:Graphics.cs

示例5: TestCloneAndEquals

		public void TestCloneAndEquals()
		{
			Bitmap bmp = new Bitmap (600, 800);
			Graphics dc = Graphics.FromImage (bmp);
			Rectangle rect1, rect2;
			Region rgn1, rgn2;
			RectangleF [] rects;
			RectangleF [] rects2;
			Matrix matrix = new Matrix ();

			rect1 = new Rectangle (500, 30, 60, 80);
			rect2 = new Rectangle (520, 40, 60, 80);
			rgn1 = new Region (rect1);
			rgn1.Union (rect2);
			rgn2 = rgn1.Clone ();

			rects = rgn1.GetRegionScans (matrix);
			rects2 = rgn2.GetRegionScans (matrix);

			Assert.AreEqual (rects.Length, rects2.Length);

			for (int i = 0; i < rects.Length; i++) {

				Assert.AreEqual (rects[i].X, rects[i].X);
				Assert.AreEqual (rects[i].Y, rects[i].Y);
				Assert.AreEqual (rects[i].Width, rects[i].Width);
				Assert.AreEqual (rects[i].Height, rects[i].Height);
			}

			Assert.AreEqual (true, rgn1.Equals (rgn2, dc));
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:31,代碼來源:TestRegion.cs

示例6: GetRegionNameInString

 public string GetRegionNameInString(Region region)
 {
     if (region.Equals(Player.FrontField))
     {
         return "前衛區";
     }
     else if (region.Equals(Player.BackField))
     {
         return "後衛區";
     }
     else if (region.Equals(Player.Deck))
     {
         return "卡組";
     }
     else if (region.Equals(Player.Grave))
     {
         return "退避區";
     }
     else if (region.Equals(Player.Hand))
     {
         return "手卡";
     }
     else if (region.Equals(Player.Kizuna) || region.Equals(Player.KizunaUsed))
     {
         return "羈絆區";
     }
     else if (region.Equals(Player.Orb))
     {
         return "寶玉區";
     }
     else if (region.Equals(Player.Support))
     {
         return "支援區";
     }
     else if (region.Equals(Rival.FrontField))
     {
         return "對手前衛區";
     }
     else if (region.Equals(Rival.BackField))
     {
         return "對手後衛區";
     }
     else
     {
         return "Error";
     }
 }
開發者ID:jacksonstarry,項目名稱:FECipherVit,代碼行數:47,代碼來源:FECipherVit.cs

示例7: GetRegionNameInString

 public string GetRegionNameInString(Region region)
 {
     if (Language == Language.Chinese)
     {
         if (region.Equals(Player.FrontField))
         {
             return "前衛區";
         }
         else if (region.Equals(Player.BackField))
         {
             return "後衛區";
         }
         else if (region.Equals(Player.Deck))
         {
             return "卡組";
         }
         else if (region.Equals(Player.Grave))
         {
             return "退避區";
         }
         else if (region.Equals(Player.Hand))
         {
             return "手牌";
         }
         else if (region.Equals(Player.Kizuna) || region.Equals(Player.KizunaUsed))
         {
             return "羈絆區";
         }
         else if (region.Equals(Player.Orb))
         {
             return "寶玉區";
         }
         else if (region.Equals(Player.Support))
         {
             return "支援區";
         }
         else if (region.Equals(Player.Overlay))
         {
             return "疊放區";
         }
         else if (region.Equals(Rival.FrontField))
         {
             return "對手前衛區";
         }
         else if (region.Equals(Rival.BackField))
         {
             return "對手後衛區";
         }
         else
         {
             return "Error";
         }
     }
     else
     {
         if (region.Equals(Player.FrontField))
         {
             return "Frontline";
         }
         else if (region.Equals(Player.BackField))
         {
             return "Backline";
         }
         else if (region.Equals(Player.Deck))
         {
             return "Deck";
         }
         else if (region.Equals(Player.Grave))
         {
             return "Retreat";
         }
         else if (region.Equals(Player.Hand))
         {
             return "Hand";
         }
         else if (region.Equals(Player.Kizuna) || region.Equals(Player.KizunaUsed))
         {
             return "Bond";
         }
         else if (region.Equals(Player.Orb))
         {
             return "Orb";
         }
         else if (region.Equals(Player.Support))
         {
             return "Support";
         }
         else if (region.Equals(Player.Overlay))
         {
             return "Stacked";
         }
         else if (region.Equals(Rival.FrontField))
         {
             return "Opponent's Frontline";
         }
         else if (region.Equals(Rival.BackField))
         {
             return "Opponent's Backline";
         }
         else
//.........這裏部分代碼省略.........
開發者ID:sdercolin,項目名稱:FECipherVit,代碼行數:101,代碼來源:FECipherVit.cs


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