public class Dimensions extends com.aspose.ms.lang.Struct<Dimensions> implements com.aspose.ms.System.IEquatable<Dimensions>, com.aspose.ms.System.ICloneable
Represents the linear dimensions (width and height) of one raster image in arbitrary unit. Immutable struct.
Constructor and Description |
---|
Dimensions(int width,
int height)
Creates a new instance from specified width and height
|
Modifier and Type | Method and Description |
---|---|
Dimensions |
deepClone()
Returns a full copy of this instance
|
boolean |
equals(Dimensions other)
Determines whether this instance is equal with specified "Dimensions" instance
|
boolean |
equals(Object obj)
Determines whether this instance is equal with specified uncasted object, which presumably is another "Dimensions" instance
|
static Dimensions |
fromSize(Dimension size)
Generates and returns a new instance from specified java.awt.Dimension instance
|
long |
getArea()
Returns an area (Width x Height)
|
Ratio |
getAspectRatio()
Aspect ratio of this dimensions as width/height
|
static Dimensions |
getEmpty()
Returns an empty Dimensions instance
|
int |
getHeight()
Height of the image
|
int |
getWidth()
Width of the image
|
int |
hashCode()
Returns a hashcode for this instance, which cannot be changed during its lifetime
|
boolean |
isEmpty()
Determines whether this "Dimensions" instance is empty and default, i.e.
|
boolean |
isSquare()
Determines whether specified 'Dimensions' represents square, i.e.
|
static boolean |
op_Equality(Dimensions first,
Dimensions second)
Checks whether two "Dimensions" values are equal, i.e.
|
static boolean |
op_Inequality(Dimensions first,
Dimensions second)
Checks whether two "Dimensions" values are not equal, i.e.
|
Dimensions |
proportionallyResizeForNewHeight(int targetHeight)
Creates and returns new "Dimensions" instance, which is proportionally resized from current, based on specified height
|
Dimensions |
proportionallyResizeForNewWidth(int targetWidth)
Creates and returns new "Dimensions" instance, which is proportionally resized from current, based on specified width
|
String |
toString()
Returns a string representation of this "Dimensions"
|
public Dimensions(int width, int height)
Creates a new instance from specified width and height
width
- Width of the imageheight
- Height of the imagepublic Dimensions deepClone()
Returns a full copy of this instance
deepClone
in interface com.aspose.ms.System.ICloneable
public boolean equals(Dimensions other)
Determines whether this instance is equal with specified "Dimensions" instance
other
- Dimensionspublic boolean equals(Object obj)
Determines whether this instance is equal with specified uncasted object, which presumably is another "Dimensions" instance
equals
in interface com.aspose.ms.System.IEquatable<Dimensions>
equals
in class Object
obj
- Objectpublic static Dimensions fromSize(Dimension size)
Generates and returns a new instance from specified java.awt.Dimension instance
size
- java.awt.Dimensionpublic long getArea()
Returns an area (Width x Height)
public Ratio getAspectRatio()
Aspect ratio of this dimensions as width/height
public static Dimensions getEmpty()
Returns an empty Dimensions instance
public int getHeight()
Height of the image
public int getWidth()
Width of the image
public int hashCode()
Returns a hashcode for this instance, which cannot be changed during its lifetime
public boolean isEmpty()
Determines whether this "Dimensions" instance is empty and default, i.e. it doesn't store correct width and height
public boolean isSquare()
Determines whether specified 'Dimensions' represents square, i.e. if width is equal to height
public static boolean op_Equality(Dimensions first, Dimensions second)
Checks whether two "Dimensions" values are equal, i.e. they have equal width and height, or both are empty
first
- Dimensionssecond
- Dimensionspublic static boolean op_Inequality(Dimensions first, Dimensions second)
Checks whether two "Dimensions" values are not equal, i.e. their corresponding width and/or height are different
first
- Dimensionssecond
- Dimensionspublic Dimensions proportionallyResizeForNewHeight(int targetHeight)
Creates and returns new "Dimensions" instance, which is proportionally resized from current, based on specified height
targetHeight
- public Dimensions proportionallyResizeForNewWidth(int targetWidth)
Creates and returns new "Dimensions" instance, which is proportionally resized from current, based on specified width
targetWidth
- Copyright © 2018. All rights reserved.