Struct UIRect

    Definition

    Namespace:
    Tizen.NUI
    Assembly:
    Tizen.NUI.dll

    Represents a rectangular area by defining its position and size.

    public struct UIRect : IEquatable<UIRect>
    Implements
    IEquatable<><UIRect>

    Constructors

    View Source

    UIRect(float, float, float, float)

    Initializes a new instance of the UIRect struct.

    Declaration
    public UIRect(float x, float y, float width, float height)
    Parameters
    Type Name Description
    float x

    The x-coordinate of the upper-left corner of the rectangle.

    float y

    The y-coordinate of the upper-left corner of the rectangle.

    float width

    The width of the rectangle.

    float height

    The height of the rectangle.

    Fields

    View Source

    Zero

    Gets a UIRect structure with all coordinates and sizes set to zero.

    Declaration
    public static readonly UIRect Zero
    Field Value
    Type Description
    UIRect

    Properties

    View Source

    Bottom

    Gets the y-coordinate of the bottom edge of the rectangle.

    Declaration
    public float Bottom { get; }
    Property Value
    Type Description
    float
    View Source

    Center

    Gets the center UIVector2 of the rectangle.

    Declaration
    public UIVector2 Center { get; }
    Property Value
    Type Description
    UIVector2
    View Source

    Height

    Gets or sets the height of the rectangle.

    Declaration
    public float Height { readonly get; init; }
    Property Value
    Type Description
    float
    View Source

    IsEmpty

    Gets a value indicating whether this UIRect is empty.

    Declaration
    public bool IsEmpty { get; }
    Property Value
    Type Description
    bool
    View Source

    Left

    Gets the x-coordinate of the left edge of the rectangle.

    Declaration
    public float Left { get; }
    Property Value
    Type Description
    float
    View Source

    Location

    Gets or sets the location of the upper-left corner of the rectangle.

    Declaration
    public UIVector2 Location { get; init; }
    Property Value
    Type Description
    UIVector2
    View Source

    Right

    Gets the x-coordinate of the right edge of the rectangle.

    Declaration
    public float Right { get; }
    Property Value
    Type Description
    float
    View Source

    Size

    Gets or sets the size of the rectangle.

    Declaration
    public UIVector2 Size { get; init; }
    Property Value
    Type Description
    UIVector2
    View Source

    Top

    Gets the y-coordinate of the top edge of the rectangle.

    Declaration
    public float Top { get; }
    Property Value
    Type Description
    float
    View Source

    Width

    Gets or sets the width of the rectangle.

    Declaration
    public float Width { readonly get; init; }
    Property Value
    Type Description
    float
    View Source

    X

    Gets or sets the x-coordinate of the upper-left corner of the rectangle.

    Declaration
    public float X { readonly get; init; }
    Property Value
    Type Description
    float
    View Source

    Y

    Gets or sets the y-coordinate of the upper-left corner of the rectangle.

    Declaration
    public float Y { readonly get; init; }
    Property Value
    Type Description
    float

    Methods

    View Source

    Contains(float, float)

    Indicates whether the specified UIVector2 is contained within the rectangular region defined by this UIRect structure.

    Declaration
    public bool Contains(float x, float y)
    Parameters
    Type Name Description
    float x

    The x-coordinate of the UIVector2 to test.

    float y

    The y-coordinate of the UIVector2 to test.

    Returns
    Type Description
    bool

    true if x and y are contained within the rectangular region defined by this UIRect structure; otherwise, false.

    View Source

    Contains(UIRect)

    Checks if the specified rectangle is completely inside this rectangle.

    Declaration
    public bool Contains(UIRect rect)
    Parameters
    Type Name Description
    UIRect rect

    The rectangle to check.

    Returns
    Type Description
    bool

    True if the specified rectangle is completely inside this rectangle, otherwise false.

    View Source

    Contains(UIVector2)

    Indicates whether the specified UIVector2 is contained within the rectangular region defined by this UIRect structure.

    Declaration
    public bool Contains(UIVector2 pt)
    Parameters
    Type Name Description
    UIVector2 pt

    The UIVector2 to test.

    Returns
    Type Description
    bool

    true if pt is contained within the rectangular region defined by this UIRect structure; otherwise, false.

    View Source

    Deconstruct(out float, out float, out float, out float)

    Deconstructs the UIRect object into its individual components (X, Y, Width, Height).

    Declaration
    public void Deconstruct(out float x, out float y, out float width, out float height)
    Parameters
    Type Name Description
    float x

    The X coordinate of the rectangle.

    float y

    The Y coordinate of the rectangle.

    float width

    The width of the rectangle.

    float height

    The height of the rectangle.

    View Source

    Equals(object)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if obj and this instance are the same type and represent the same value; otherwise, false.

    View Source

    Equals(UIRect)

    Indicates whether this instance and another specified UIRect structure are equal.

    Declaration
    public bool Equals(UIRect other)
    Parameters
    Type Name Description
    UIRect other

    The UIRect structure to compare with the current instance.

    Returns
    Type Description
    bool

    true if other and this instance are equal; otherwise, false.

    View Source

    FromLTRB(float, float, float, float)

    Creates a new UIRect structure with the specified values.

    Declaration
    public static UIRect FromLTRB(float left, float top, float right, float bottom)
    Parameters
    Type Name Description
    float left

    The x-coordinate of the upper-left corner of the rectangle.

    float top

    The y-coordinate of the upper-left corner of the rectangle.

    float right

    The x-coordinate of the lower-right corner of the rectangle.

    float bottom

    The y-coordinate of the lower-right corner of the rectangle.

    Returns
    Type Description
    UIRect

    A new UIRect structure with the specified values.

    View Source

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer that is the hash code for this instance.

    View Source

    Inflate(float, float)

    Inflates the current rectangle by the specified width and height.

    Declaration
    public UIRect Inflate(float width, float height)
    Parameters
    Type Name Description
    float width

    The amount to inflate the rectangle horizontally.

    float height

    The amount to inflate the rectangle vertically.

    Returns
    Type Description
    UIRect

    A new rectangle that represents the inflated version of the current rectangle.

    View Source

    Inflate(UIVector2)

    Returns a new UIRect structure that has been inflated by the specified amount.

    Declaration
    public UIRect Inflate(UIVector2 sz)
    Parameters
    Type Name Description
    UIVector2 sz

    The size of the inflation.

    Returns
    Type Description
    UIRect

    A new UIRect structure that represents the inflated rectangle.

    View Source

    Intersect(UIRect, UIRect)

    Returns a new rectangle that represents the intersection of two given rectangles.

    Declaration
    public static UIRect Intersect(UIRect r1, UIRect r2)
    Parameters
    Type Name Description
    UIRect r1

    The first rectangle.

    UIRect r2

    The second rectangle.

    Returns
    Type Description
    UIRect

    A new rectangle representing the intersection of the two given rectangles.

    View Source

    Intersect(UIRect)

    Returns a new rectangle that represents the intersection of the current rectangle and the specified rectangle.

    Declaration
    public UIRect Intersect(UIRect r)
    Parameters
    Type Name Description
    UIRect r

    The rectangle to intersect with the current rectangle.

    Returns
    Type Description
    UIRect

    A new rectangle that represents the intersection of the current rectangle specified rectangle.

    View Source

    IntersectsWith(UIRect)

    Indicates whether the rectangular region represented by this UIRect intersects with the rectangular region represented by the specified UIRect structure.

    Declaration
    public bool IntersectsWith(UIRect r)
    Parameters
    Type Name Description
    UIRect r

    The UIRect structure to test for intersection.

    Returns
    Type Description
    bool

    true if the rectangular region represented by this UIRect intersects with the rectangular region represented by r; otherwise, false.

    View Source

    Offset(float, float)

    Returns a new rectangle that is offset by the specified amount.

    Declaration
    public UIRect Offset(float dx, float dy)
    Parameters
    Type Name Description
    float dx

    The horizontal offset.

    float dy

    The vertical offset.

    Returns
    Type Description
    UIRect

    A new rectangle with the offset applied.

    View Source

    Offset(UIVector2)

    Returns a new UIRect that has been offset by the specified distance.

    Declaration
    public UIRect Offset(UIVector2 dr)
    Parameters
    Type Name Description
    UIVector2 dr

    The distance to offset the UIRect.

    Returns
    Type Description
    UIRect

    A new UIRect that has been offset by the specified distance.

    View Source

    Round()

    Rounds the values of the X, Y, Width, and Height properties of the current UIRect object to the nearest whole number.

    Declaration
    public UIRect Round()
    Returns
    Type Description
    UIRect

    A new UIRect object with the rounded values.

    View Source

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    View Source

    Union(UIRect, UIRect)

    Returns a rectangle that represents the union of the two given rectangles.

    Declaration
    public static UIRect Union(UIRect r1, UIRect r2)
    Parameters
    Type Name Description
    UIRect r1

    The first rectangle.

    UIRect r2

    The second rectangle.

    Returns
    Type Description
    UIRect

    A new rectangle that represents the union of the two given rectangles.

    View Source

    Union(UIRect)

    Returns a rectangle that represents the union of the current rectangle and the specified rectangle.

    Declaration
    public UIRect Union(UIRect r)
    Parameters
    Type Name Description
    UIRect r

    The rectangle to combine with the current rectangle.

    Returns
    Type Description
    UIRect

    A new rectangle that represents the union of the current rectangle and the specified rectangle.

    Operators

    View Source

    operator ==(UIRect, UIRect)

    Compares two UIRect structures for equality.

    Declaration
    public static bool operator ==(UIRect r1, UIRect r2)
    Parameters
    Type Name Description
    UIRect r1

    The first UIRect structure to compare.

    UIRect r2

    The second UIRect structure to compare.

    Returns
    Type Description
    bool

    true if r1 and r2 are equal; otherwise, false.

    View Source

    operator !=(UIRect, UIRect)

    Compares two UIRect structures for inequality.

    Declaration
    public static bool operator !=(UIRect r1, UIRect r2)
    Parameters
    Type Name Description
    UIRect r1

    The first UIRect structure to compare.

    UIRect r2

    The second UIRect structure to compare.

    Returns
    Type Description
    bool

    true if r1 and r2 are not equal; otherwise, false.

    Implements

    IEquatable<>

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX