本文整理汇总了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));
}
示例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");
}
示例3: ClipTest_1
public void ClipTest_1() {
Region r = new Region();
Assert.IsTrue(r.Equals(t.Graphics.Clip, t.Graphics));
}
示例4: ClipTest_1
public void ClipTest_1() {
Region r = new Region();
Assert.That(r.Equals(t.Graphics.Clip, t.Graphics), Is.True);
}
示例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));
}
示例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";
}
}
示例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
//.........这里部分代码省略.........