__init__ constructor

On this page

init

Initializes a rectangle from corner coordinates and dimensions.

def __init__(self, x, y, width, height):
    ...
Parameter Type Description
x int Top-left horizontal offset in pixels.
y int Top-left vertical offset in pixels.
width int Area width in pixels.
height int Area height in pixels.

Example

from groupdocs.redaction.options.drawing import Rectangle

# Create a rectangle at (40, 40) with width 120 and height 40
rect = Rectangle(40, 40, 120, 40)

init

Initializes a rectangle from a top-left point and region size.

def __init__(self, location, size):
    ...
Parameter Type Description
location Point Top-left corner of the area.
size Size Width and height of the area.

See Also

On this page