Rectangle constructor

init

Constructs a new instance of Rectangle

def __init__(self):
    ...

init

Initializes a new instance of the Rectangle structure with the specified location and size.

def __init__(self, location, size):
    ...
ParameterTypeDescription
locationPointA Point that represents the upper-left corner of the rectangular region.
sizeSizeA Size that represents the width and height of the rectangular region.

init

Initializes a new instance of the Rectangle structure with the specified location and size.

def __init__(self, x, y, width, height):
    ...
ParameterTypeDescription
xintThe x-coordinate of the upper-left corner of the rectangle.
yintThe y-coordinate of the upper-left corner of the rectangle.
widthintThe width of the rectangle.
heightintThe height of the rectangle.

See Also