Class MagickGeometry
- Namespace
- ImageMagick
- Assembly
- Magick.NET-Q16-AnyCPU.dll
Encapsulation of the ImageMagick geometry object.
public sealed class MagickGeometry : IMagickGeometry, IEquatable<IMagickGeometry?>, IComparable<IMagickGeometry?>
- Inheritance
-
MagickGeometry
- Implements
-
IMagickGeometryIEquatable<IMagickGeometry>IComparable<IMagickGeometry>
- Inherited Members
Constructors
MagickGeometry()
Initializes a new instance of the MagickGeometry class.
public MagickGeometry()
MagickGeometry(Percentage, Percentage)
Initializes a new instance of the MagickGeometry class using the specified width and height.
public MagickGeometry(Percentage percentageWidth, Percentage percentageHeight)
Parameters
percentageWidthPercentageThe percentage of the width.
percentageHeightPercentageThe percentage of the height.
MagickGeometry(int)
Initializes a new instance of the MagickGeometry class using the specified width and height.
public MagickGeometry(int widthAndHeight)
Parameters
widthAndHeightintThe width and height.
MagickGeometry(int, int)
Initializes a new instance of the MagickGeometry class using the specified width and height.
public MagickGeometry(int width, int height)
Parameters
MagickGeometry(int, int, Percentage, Percentage)
Initializes a new instance of the MagickGeometry class using the specified offsets, width and height.
public MagickGeometry(int x, int y, Percentage percentageWidth, Percentage percentageHeight)
Parameters
xintThe X offset from origin.
yintThe Y offset from origin.
percentageWidthPercentageThe percentage of the width.
percentageHeightPercentageThe percentage of the height.
MagickGeometry(int, int, int, int)
Initializes a new instance of the MagickGeometry class using the specified offsets, width and height.
public MagickGeometry(int x, int y, int width, int height)
Parameters
xintThe X offset from origin.
yintThe Y offset from origin.
widthintThe width.
heightintThe height.
MagickGeometry(string)
Initializes a new instance of the MagickGeometry class using the specified geometry.
public MagickGeometry(string value)
Parameters
valuestringGeometry specifications in the form: <width>x<height> {+-}<xoffset>{+-}<yoffset> (where width, height, xoffset, and yoffset are numbers).
Properties
AspectRatio
Gets a value indicating whether the value is an aspect ratio.
public bool AspectRatio { get; }
Property Value
FillArea
Gets or sets a value indicating whether the image is resized based on the smallest fitting dimension (^).
public bool FillArea { get; set; }
Property Value
Greater
Gets or sets a value indicating whether the image is resized if image is greater than size (>).
public bool Greater { get; set; }
Property Value
Height
Gets or sets the height of the geometry.
public int Height { get; set; }
Property Value
IgnoreAspectRatio
Gets or sets a value indicating whether the image is resized without preserving aspect ratio (!).
public bool IgnoreAspectRatio { get; set; }
Property Value
IsPercentage
Gets or sets a value indicating whether the width and height are expressed as percentages.
public bool IsPercentage { get; set; }
Property Value
Less
Gets or sets a value indicating whether the image is resized if the image is less than size (<).
public bool Less { get; set; }
Property Value
LimitPixels
Gets or sets a value indicating whether the image is resized using a pixel area count limit (@).
public bool LimitPixels { get; set; }
Property Value
Width
Gets or sets the width of the geometry.
public int Width { get; set; }
Property Value
X
Gets or sets the X offset from origin.
public int X { get; set; }
Property Value
Y
Gets or sets the Y offset from origin.
public int Y { get; set; }
Property Value
Methods
CompareTo(IMagickGeometry?)
Compares the current instance with another object of the same type.
public int CompareTo(IMagickGeometry? other)
Parameters
otherIMagickGeometryThe object to compare this geometry with.
Returns
- int
A signed number indicating the relative values of this instance and value.
Equals(IMagickGeometry?)
Determines whether the specified ImageMagick.IMagickGeometry is equal to the current MagickGeometry.
public bool Equals(IMagickGeometry? other)
Parameters
otherIMagickGeometryThe ImageMagick.IMagickGeometry to compare this MagickGeometry with.
Returns
- bool
True when the specified ImageMagick.IMagickGeometry is equal to the current MagickGeometry.
Equals(object?)
Determines whether the specified object is equal to the current MagickGeometry.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare this MagickGeometry with.
Returns
- bool
True when the specified object is equal to the current MagickGeometry.
FromPageSize(string)
Initializes a new ImageMagick.IMagickGeometry instance using the specified page size.
public static IMagickGeometry FromPageSize(string pageSize)
Parameters
pageSizestringThe page size.
Returns
- IMagickGeometry
A ImageMagick.IMagickGeometry instance that represents the specified page size at 72 dpi.
GetHashCode()
Serves as a hash of this type.
public override int GetHashCode()
Returns
- int
A hash code for the current instance.
Initialize(int, int, int, int)
Initializes the geometry using the specified value.
public void Initialize(int x, int y, int width, int height)
Parameters
xintThe X offset from origin.
yintThe Y offset from origin.
widthintThe width.
heightintThe height.
ToString()
Returns a string that represents the current ImageMagick.IMagickGeometry.
public override string ToString()
Returns
- string
A string that represents the current ImageMagick.IMagickGeometry.
Operators
operator ==(MagickGeometry, MagickGeometry)
Determines whether the specified MagickGeometry instances are considered equal.
public static bool operator ==(MagickGeometry left, MagickGeometry right)
Parameters
leftMagickGeometryThe first MagickGeometry to compare.
rightMagickGeometryThe second MagickGeometry to compare.
Returns
explicit operator MagickGeometry(string)
Converts the specified string to an instance of this type.
public static explicit operator MagickGeometry(string value)
Parameters
valuestringGeometry specifications in the form: <width>x<height> {+-}<xoffset>{+-}<yoffset> (where width, height, xoffset, and yoffset are numbers).
Returns
operator >(MagickGeometry, MagickGeometry)
Determines whether the first MagickGeometry is more than the second MagickGeometry.
public static bool operator >(MagickGeometry left, MagickGeometry right)
Parameters
leftMagickGeometryThe first MagickGeometry to compare.
rightMagickGeometryThe second MagickGeometry to compare.
Returns
operator >=(MagickGeometry, MagickGeometry)
Determines whether the first MagickGeometry is more than or equal to the second MagickGeometry.
public static bool operator >=(MagickGeometry left, MagickGeometry right)
Parameters
leftMagickGeometryThe first MagickGeometry to compare.
rightMagickGeometryThe second MagickGeometry to compare.
Returns
operator !=(MagickGeometry, MagickGeometry)
Determines whether the specified MagickGeometry instances are not considered equal.
public static bool operator !=(MagickGeometry left, MagickGeometry right)
Parameters
leftMagickGeometryThe first MagickGeometry to compare.
rightMagickGeometryThe second MagickGeometry to compare.
Returns
operator <(MagickGeometry, MagickGeometry)
Determines whether the first MagickGeometry is less than the second MagickGeometry.
public static bool operator <(MagickGeometry left, MagickGeometry right)
Parameters
leftMagickGeometryThe first MagickGeometry to compare.
rightMagickGeometryThe second MagickGeometry to compare.
Returns
operator <=(MagickGeometry, MagickGeometry)
Determines whether the first MagickGeometry is less than or equal to the second MagickGeometry.
public static bool operator <=(MagickGeometry left, MagickGeometry right)
Parameters
leftMagickGeometryThe first MagickGeometry to compare.
rightMagickGeometryThe second MagickGeometry to compare.