Constructs a rectangle given a top-left location, width and height.


Rectangle(int x, int y, int width, int height);
Rectangle(Point location, Size sz);

[Visual Basic]

Sub New(x As Integer, y As Integer, width As Integer, height As Integer)
Sub New(location As Point, sz As Size)
Name Description
x The left coordinate.
y The top coordinate.
width The width.
height The height.
location The top-left location.
sz The size.




Rectangle rect = new Rectangle(10, 10, 190, 90);
Response.Write($"Top = {rect.Top}<br>");
Response.Write($"Right = {rect.Right}<br>");
Response.Write($"Bottom = {rect.Bottom}<br>");
Response.Write($"Left = {rect.Left}<br>");
Response.Write($"Left = {rect.Left}<br>");
Response.Write($"Height = {rect.Height}<br>");

This produces the following output.

Top = 10
Right = 200
Bottom = 100
Left = 10
Width = 190
Height = 90