当前位置: 首页>>代码示例>>C#>>正文


C# Rectangle.IntersectionWith方法代码示例

本文整理汇总了C#中Rectangle.IntersectionWith方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.IntersectionWith方法的具体用法?C# Rectangle.IntersectionWith怎么用?C# Rectangle.IntersectionWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rectangle的用法示例。


在下文中一共展示了Rectangle.IntersectionWith方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EqualRectanglesIntersectionIsTheSame

        public void EqualRectanglesIntersectionIsTheSame()
        {
            Rectangle a = new Rectangle (1, 2, 3, 4);
            Rectangle b = new Rectangle (1, 2, 3, 4);
            Rectangle c = a.IntersectionWith (b);

            Assert.That (c, Is.EqualTo (new Rectangle (1, 2, 3, 4)));
        }
开发者ID:manicolosi,项目名称:questar,代码行数:8,代码来源:RectangleFixture.cs

示例2: EqualIntersection

        public void EqualIntersection()
        {
            Rectangle a = new Rectangle (1, 1, 5, 5);
            Rectangle b = new Rectangle (3, 3, 5, 5);
            Rectangle c = a.IntersectionWith (b);

            Assert.That (c, Is.EqualTo (new Rectangle (3, 3, 3, 3)));
        }
开发者ID:manicolosi,项目名称:questar,代码行数:8,代码来源:RectangleFixture.cs

示例3: BothRectanglesMustContainEachPointOfTheirIntersection

        public void BothRectanglesMustContainEachPointOfTheirIntersection()
        {
            Rectangle a = new Rectangle (1, 1, 5, 5);
            Rectangle b = new Rectangle (3, 3, 5, 5);
            Rectangle c = a.IntersectionWith (b);

            foreach (Point p in c) {
                Assert.That (a.Contains (p), Is.True);
                Assert.That (b.Contains (p), Is.True);
            }
        }
开发者ID:manicolosi,项目名称:questar,代码行数:11,代码来源:RectangleFixture.cs

示例4: NonIntersectingRectanglesNotAllowed

 public void NonIntersectingRectanglesNotAllowed()
 {
     Rectangle a = new Rectangle (0, 0, 2, 2);
     Rectangle b = new Rectangle (2, 0, 2, 2);
     a.IntersectionWith (b);
 }
开发者ID:manicolosi,项目名称:questar,代码行数:6,代码来源:RectangleFixture.cs

示例5: IntersectionWithParameterOrderDoesntMatter

        public void IntersectionWithParameterOrderDoesntMatter()
        {
            Rectangle a = new Rectangle (1, 1, 5, 5);
            Rectangle b = new Rectangle (3, 3, 5, 5);
            Rectangle c = a.IntersectionWith (b);
            Rectangle d = b.IntersectionWith (a);

            Assert.That (c, Is.EqualTo (d));
        }
开发者ID:manicolosi,项目名称:questar,代码行数:9,代码来源:RectangleFixture.cs

示例6: SinglePointIntersection

        public void SinglePointIntersection()
        {
            Rectangle a = new Rectangle (0, 0, 2, 2);
            Rectangle b = new Rectangle (1, 1, 2, 2);
            Rectangle c = a.IntersectionWith (b);

            Assert.That (c, Is.EqualTo (new Rectangle (1, 1, 1, 1)));
        }
开发者ID:manicolosi,项目名称:questar,代码行数:8,代码来源:RectangleFixture.cs

示例7: SameStartingPointIntersectionHasSmallestDimensions

        public void SameStartingPointIntersectionHasSmallestDimensions()
        {
            Rectangle a = new Rectangle (10, 15);
            Rectangle b = new Rectangle (15, 10);
            Rectangle c = a.IntersectionWith (b);

            Assert.That (c, Is.EqualTo (new Rectangle (0, 0, 10, 10)));
        }
开发者ID:manicolosi,项目名称:questar,代码行数:8,代码来源:RectangleFixture.cs

示例8: RectangleInsideOfAnotherIntersection

        public void RectangleInsideOfAnotherIntersection()
        {
            Rectangle a = new Rectangle (2, 2, 5, 5);
            Rectangle b = new Rectangle (3, 3, 3, 3);
            Rectangle c = a.IntersectionWith (b);

            Assert.That (c, Is.EqualTo (new Rectangle (3, 3, 3, 3)));
        }
开发者ID:manicolosi,项目名称:questar,代码行数:8,代码来源:RectangleFixture.cs


注:本文中的Rectangle.IntersectionWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。