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


C# RectangleF.Inflate方法代码示例

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


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

示例1: TestInflate

    public void TestInflate() {
      RectangleF testRectangle = new RectangleF(1.2f, 3.4f, 5.6f, 7.8f);

      testRectangle.Inflate(10.0f, 100.0f);

      Assert.That(testRectangle.X, Is.EqualTo(-8.8f).Within(4).Ulps);
      Assert.That(testRectangle.Y, Is.EqualTo(-96.6f).Within(4).Ulps);
      Assert.That(testRectangle.Width, Is.EqualTo(25.6f).Within(4).Ulps);
      Assert.That(testRectangle.Height, Is.EqualTo(207.8f).Within(4).Ulps);
    }
开发者ID:pr0gramm3r1,项目名称:AngryTanks,代码行数:10,代码来源:RectangleF.Test.cs

示例2: InflateTest

        public void InflateTest(float x, float y, float width, float height)
        {
            RectangleF rect = new RectangleF(x, y, width, height);
            RectangleF inflatedRect = new RectangleF(x - width, y - height, width + 2 * width, height + 2 * height);

            rect.Inflate(width, height);
            Assert.Equal(inflatedRect, rect);

            SizeF s = new SizeF(x, y);
            inflatedRect = RectangleF.Inflate(rect, x, y);

            rect.Inflate(s);
            Assert.Equal(inflatedRect, rect);
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:14,代码来源:RectangleFTests.cs

示例3: InflateTest

 public void InflateTest()
 {
     RectangleF target = new RectangleF(0f, 0f, 100f, 100f);
     float horizontalAmount = 2f;
     float verticalAmount = 2f;
     target.Inflate(horizontalAmount, verticalAmount);
     
     Assert.AreEqual(-2f, target.X);
     Assert.AreEqual(-2f, target.Y);
     Assert.AreEqual(102f, target.Right);
     Assert.AreEqual(102f, target.Bottom);
 }
开发者ID:shadercoder,项目名称:Icicle-Framework,代码行数:12,代码来源:RectangleFTest.cs

示例4: drawPoints

        private void drawPoints(Bgr<byte>[,] im, List<PointF> points)
        {
            foreach (var pt in points)
            {                
                var rect = new RectangleF(pt.X, pt.Y, 1, 1);
                rect.Inflate(winSize / 2, winSize / 2);

                im.Draw(rect, Bgr<byte>.Red, 2);
            }
        }
开发者ID:Candy29,项目名称:accord-net-extensions,代码行数:10,代码来源:KLDemo.cs

示例5: InflateRect

 public static RectangleF InflateRect(RectangleF rect, float delta)
 {
     rect.Inflate(delta, delta);
     return rect;
 }
开发者ID:jonc,项目名称:carto,代码行数:5,代码来源:Util.cs

示例6: TestInflate

        public void TestInflate()
        {
            RectangleF testRectangle = new RectangleF(1.2f, 3.4f, 5.6f, 7.8f);

            testRectangle.Inflate(10.0f, 100.0f);

            Assert.AreEqual(-8.8f, testRectangle.X, .0004);
            Assert.AreEqual(-96.6f, testRectangle.Y, .0004);
            Assert.AreEqual(25.6f, testRectangle.Width, .0004);
            Assert.AreEqual(207.8f, testRectangle.Height, .0004);
        }
开发者ID:GeekyMonkey,项目名称:ScratchyXNA,代码行数:11,代码来源:RectangleFTests.cs


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