zoukankan      html  css  js  c++  java
  • Rectangle.Inflate

    C# Rectangle.Inflate 方法将Rectangle 结构放大指定量

     

    命名空间:System.Drawing
    程序集:System.Drawing(在 system.drawing.dll 中)

    重载列表

    Rectangle.Inflate (Size)                           将此 Rectangle放大指定量。

    Rectangle.Inflate (Int32, Int32)                将此 Rectangle放大指定量。

    Rectangle.Inflate (Rectangle, Int32, Int32) 创建并返回指定 Rectangle结构的放大副本。该副本被放大指定的量。不修改原始 Rectangle结构。

    应用:Rectangle.Inflate (Int32, Int32)

    参数
    width

    Rectangle的水平放大量。

    height

    Rectangle的垂直放大量。

    备注

    此方法放大此矩形,而不是放大它的副本。沿轴放大是沿两个方向(正方向和负方向)进行的。例如,如果 50 x 50 的矩形沿 x 轴放大 50,则结果矩形的长度为 150 个单位,即原始 50,负方向 50,正方向 50,以保持矩形的几何中心不变。

    如果 x 或 y 为负数,则 Rectangle结构沿着相应的方向缩小。

    示例1:下面的示例创建一个 Rectangle结构,并沿 x ,y轴方向将其放大 100 个单位:

               // Create a rectangle.
               Rectangle rect = new Rectangle(100, 100, 50, 50);
               Graphics g = CreateGraphics();
               // Draw the uninflated rectangle to screen.
               g.DrawRectangle(Pens.Black, rect);

               // Call Inflate.
               rect.Inflate(50, 50);

               // Draw the inflated rectangle to screen.
               g.DrawRectangle(Pens.Red, rect);

    示例2:下面的示例创建一个 Rectangle结构,并沿 x 轴方向将其缩小 10 个单位,沿 y 轴方向将其放大 10 个单位:

              // Create a rectangle.
               Rectangle rect = new Rectangle(100, 100, 50, 50);
               Graphics g = CreateGraphics();
               // Draw the uninflated rectangle to screen.
               g.DrawRectangle(Pens.Black, rect);

               // Call Inflate.
               rect.Inflate(-10, 10);

               // Draw the inflated rectangle to screen.
               g.DrawRectangle(Pens.Red, rect);

  • 相关阅读:
    EasyUi datagrid列表增加复选框
    List集合流处理类型小结
    MockMvc模拟对controller进行单元测试
    项目配置不带项目名称访问
    mongodb常用的sql语句总结
    git push时报错:Updates were rejected because the tip of your current branch is behind
    xml转json和实体类的两种方式
    win 10 关闭或打开 测试模式
    Wise Force Deleter 强制删除文件工具 ---- 亲测好用
    Win 10 你不能访问此共享文件夹,因为你组织的安全策略阻止未经身份验证的来宾访问....
  • 原文地址:https://www.cnblogs.com/laogao/p/3070515.html
Copyright © 2011-2022 走看看