RelativeRectangle class

RelativeRectangle class

Relative rectangle The formula between relative component to absolute value is: Scale * (Reference Width) + offset So if we want it to represent an absolute value, leave all scale fields zero, and use offset fields instead.

The RelativeRectangle type exposes the following members:

Constructors

ConstructorDescription
__init__(self, left, top, width, height)Construct a RelativeRectangle
__init__(self)Constructs a new instance of RelativeRectangle

Properties

PropertyDescription
scale_xRelative coordinate X
scale_yRelative coordinate Y
scale_widthRelative width
scale_heightRelative height
offset_xGets or sets the offset for coordinate X
offset_yGets or sets the offset for coordinate Y
offset_widthGets or sets the offset for width
offset_heightGets or sets the offset for height

Methods

MethodDescription
to_absolute(self, left, top, width, height)Convert the relative rectangle to absolute rectangle
from_scale(, scale_x, scale_y, scale_width, scale_height)Construct a RelativeRectangle with all offset fields zero and scale fields from given parameters.

See Also