__init__ constructor

init

Initializes a new Rectangle.

def __init__(self, x, y, width, height):
    ...
Parameter Type Description
x float The x coordinate (top left corner of the rectangle).
y float The y coordinate (top left corner of the rectangle).
width float The width of the rectangle.
height float The height of the rectangle.

Example

from groupdocs.annotation.models import Rectangle

# Create a rectangle at position (100, 100) with width 200 and height 80
rect = Rectangle(100, 100, 200, 80)

See Also