Class ResizeUtil.Rect
Utility class for calculating image dimensions
Inheritance
Inherited Members
Namespace: ImageVault.Core.Conversion
Assembly: ImageVault.Core.dll
Syntax
public class Rect
Constructors
Rect()
Initializes a new instance of the Rect class.
Declaration
public Rect()
Rect(Int32, Int32, Boolean)
Initializes a new instance of the Rect class.
Declaration
public Rect(int width, int height, bool retainAspectRatio)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | |
System.Int32 | height | |
System.Boolean | retainAspectRatio |
Rect(Int32, Int32, Int32, Int32)
Initializes a new instance of the Rect class.
Declaration
public Rect(int xOffset, int yOffset, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | xOffset | |
System.Int32 | yOffset | |
System.Int32 | width | |
System.Int32 | height |
Properties
Height
Get/Sets the Height of the Rect
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsEmpty
Gets the IsEmpty of the Rect
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Width
Get/Sets the Width of the Rect
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
XOffset
Get/Sets the XOffset of the Rect
Declaration
public int XOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
YOffset
Get/Sets the YOffset of the Rect
Declaration
public int YOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Equals(ResizeUtil.Rect)
Determines whether the specified ResizeUtil.Rect is equal to the current Rect.
Declaration
protected bool Equals(ResizeUtil.Rect other)
Parameters
Type | Name | Description |
---|---|---|
ResizeUtil.Rect | other | The ResizeUtil.Rect to compare with the current ResizeUtil.Rect. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified ResizeUtil.Rect is equal to the current Rect; otherwise, false. |
Equals(Object)
Determines whether the specified System.Object is equal to the current Rect.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current ResizeUtil.Rect. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified System.Object is equal to the current Rect; otherwise, false. |
Overrides
FitInside(ResizeUtil.Rect)
Fit the current Rect inside the bounding Rect passed
Declaration
public ResizeUtil.Rect FitInside(ResizeUtil.Rect boundingRect)
Parameters
Type | Name | Description |
---|---|---|
ResizeUtil.Rect | boundingRect |
Returns
Type | Description |
---|---|
ResizeUtil.Rect |
GetHashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current ResizeUtil.Rect. |
Overrides
ToRectangle()
Declaration
public Rectangle ToRectangle()
Returns
Type | Description |
---|---|
System.Drawing.Rectangle |
ToString()
Returns a System.String that represents the current ResizeUtil.Rect.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents the current ResizeUtil.Rect. |