Struct Rectangle
Namespace: Aspose.OCR
Assembly: Aspose.OCR.dll (25.2.0)
Stores a set of four integers that represent the location and size of a rectangle.
public struct Rectangle
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Rectangle(int, int, int, int)
Initializes a new instance of the Aspose.OCR.Rectangle structure with the specified location and size.
public Rectangle(int x, int y, int width, int height)
Parameters
x
int
The x-coordinate of the upper-left corner of the rectangle.
y
int
The y-coordinate of the upper-left corner of the rectangle.
width
int
The width of the rectangle.
height
int
The height of the rectangle.
Fields
Height
The rectangle width.
public int Height
Field Value
Width
The rectangle height.
public int Width
Field Value
X
The rectangle x location.
public int X
Field Value
Y
The rectangle y location.
public int Y
Field Value
Properties
Bottom
Gets or sets the y-coordinate that is the sum of the Aspose.OCR.Rectangle.Y and Aspose.OCR.Rectangle.Height property values of this Aspose.OCR.Rectangle structure.
public int Bottom { get; set; }
Property Value
Empty
Gets a new instance of the Aspose.OCR.Rectangle structure that has Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width and Aspose.OCR.Rectangle.Height values set to zero.
public static Rectangle Empty { get; }
Property Value
IsEmpty
Gets a value indicating whether all numeric properties of this Aspose.OCR.Rectangle have values of zero.
public bool IsEmpty { get; }
Property Value
Left
Gets or sets the x-coordinate of the left edge of this Aspose.OCR..Rectangle structure.
public int Left { get; set; }
Property Value
Right
Gets or sets the x-coordinate that is the sum of Aspose.OCR.Rectangle.X and Aspose.OCR.Rectangle.Width property values of this Aspose.OCR.Rectangle structure.
public int Right { get; set; }
Property Value
Top
Gets or sets the y-coordinate of the top edge of this Aspose.OCR.Rectangle structure.
public int Top { get; set; }
Property Value
Methods
Contains(int, int)
Determines if the specified point is contained within this Aspose.OCR.Rectangle structure.
public bool Contains(int x, int y)
Parameters
x
int
The x-coordinate of the point to test.
y
int
The y-coordinate of the point to test.
Returns
This method returns true if the point defined by x
and y
is contained within this Aspose.OCR.Rectangle structure; otherwise false.
Equals(object)
Tests whether obj
is a Aspose.OCR.Rectangle structure with the same location and size of this Aspose.OCR.Rectangle structure.
public override bool Equals(object obj)
Parameters
obj
object
The System.Object to test.
Returns
This method returns true if obj
is a Aspose.OCR.Rectangle structure and its Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width, and Aspose.OCR.Rectangle.Height properties are equal to the corresponding properties of this Aspose.OCR.Rectangle structure; otherwise, false.
GetHashCode()
Returns the hash code for this Aspose.OCR.Rectangle structure.
public override int GetHashCode()
Returns
An integer that represents the hash code for this rectangle.
ToString()
Converts the attributes of this Aspose.OCR.Rectangle to a human-readable string.
public override string ToString()
Returns
A string that contains the position, width, and height of this Aspose.OCR.Rectangle structure.
Operators
operator ==(Rectangle, Rectangle)
Tests whether two Aspose.OCR.Rectangle structures have equal location and size.
public static bool operator ==(Rectangle left, Rectangle right)
Parameters
left
Rectangle
The Aspose.OCR.Rectangle structure that is to the left of the equality operator.
right
Rectangle
The Aspose.OCR.Rectangle structure that is to the right of the equality operator.
Returns
This operator returns true if the two Aspose.OCR.Rectangle structures have equal Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width, and Aspose.OCR.Rectangle.Height properties.
operator !=(Rectangle, Rectangle)
Tests whether two Aspose.OCR.Rectangle structures differ in location or size.
public static bool operator !=(Rectangle left, Rectangle right)
Parameters
left
Rectangle
The Aspose.OCR.Rectangle structure that is to the left of the inequality operator.
right
Rectangle
The Aspose.OCR.Rectangle structure that is to the right of the inequality operator.
Returns
This operator returns true if any of the Aspose.OCR.Rectangle.X, Aspose.OCR.Rectangle.Y, Aspose.OCR.Rectangle.Width or Aspose.OCR.Rectangle.Height properties of the two Aspose.OCR.Rectangle structures are unequal; otherwise false.