Stores a set of four integers that represent the location and size of a rectangle
コード例 #1
0
ファイル: Size.cs プロジェクト: nothingmn/AGENT.Contrib
 public Point CenterWithin(Rectangle container)
 {
     return new Point(((container.Width - Width) >> 1) + container.X, ((container.Height - Height) >> 1) + container.Y);
 }
コード例 #2
0
ファイル: Rectangle.cs プロジェクト: nothingmn/AGENT.Contrib
 /// <summary>
 /// Tests whether the System.Drawing.Rectangle structure has the same location and size of this System.Drawing.Rectangle structure.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(Rectangle other)
 {
     return m_X == other.m_X && m_Y == other.m_Y && m_Width == other.m_Width && m_Height == other.m_Height;
 }