RelativeRectangle

RelativeRectangle structure

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.

public struct RelativeRectangle

Properties

Name Description
OffsetHeight { get; set; } Gets or sets the offset for height
OffsetWidth { get; set; } Gets or sets the offset for width
OffsetX { get; set; } Gets or sets the offset for coordinate X
OffsetY { get; set; } Gets or sets the offset for coordinate Y
ScaleHeight { get; set; } Relative height
ScaleWidth { get; set; } Relative width
ScaleX { get; set; } Relative coordinate X
ScaleY { get; set; } Relative coordinate Y

Methods

Name Description
static FromScale(float, float, float, float) Construct a RelativeRectangle with all offset fields zero and scale fields from given parameters.
ToAbsolute(Rectangle) Convert the relative rectangle to absolute rectangle
ToAbsolute(Size) Convert the relative rectangle to absolute rectangle
override ToString() Converts the value of this instance to a String.

See Also