Class MagickGeometry
- Namespace
- ImageMagick
- Assembly
- Magick.NET-Q8-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
- percentageWidthPercentage
- The percentage of the width. 
- percentageHeightPercentage
- The percentage of the height. 
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
- xint
- The X offset from origin. 
- yint
- The Y offset from origin. 
- percentageWidthPercentage
- The percentage of the width. 
- percentageHeightPercentage
- The percentage of the height. 
MagickGeometry(int, int, uint, uint)
Initializes a new instance of the MagickGeometry class using the specified offsets, width and height.
public MagickGeometry(int x, int y, uint width, uint height)Parameters
- xint
- The X offset from origin. 
- yint
- The Y offset from origin. 
- widthuint
- The width. 
- heightuint
- The height. 
MagickGeometry(string)
Initializes a new instance of the MagickGeometry class using the specified geometry.
public MagickGeometry(string value)Parameters
- valuestring
- Geometry specifications in the form: <width>x<height> {+-}<xoffset>{+-}<yoffset> (where width, height, xoffset, and yoffset are numbers). 
MagickGeometry(uint)
Initializes a new instance of the MagickGeometry class using the specified width and height.
public MagickGeometry(uint widthAndHeight)Parameters
- widthAndHeightuint
- The width and height. 
MagickGeometry(uint, uint)
Initializes a new instance of the MagickGeometry class using the specified width and height.
public MagickGeometry(uint width, uint height)Parameters
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 uint 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 uint 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
- otherIMagickGeometry
- The 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
- otherIMagickGeometry
- The 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
- objobject
- The 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
- pageSizestring
- The 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, uint, uint)
Initializes the geometry using the specified value.
public void Initialize(int x, int y, uint width, uint height)Parameters
- xint
- The X offset from origin. 
- yint
- The Y offset from origin. 
- widthuint
- The width. 
- heightuint
- The 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
- leftMagickGeometry
- The first MagickGeometry to compare. 
- rightMagickGeometry
- The 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
- valuestring
- Geometry 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
- leftMagickGeometry
- The first MagickGeometry to compare. 
- rightMagickGeometry
- The 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
- leftMagickGeometry
- The first MagickGeometry to compare. 
- rightMagickGeometry
- The 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
- leftMagickGeometry
- The first MagickGeometry to compare. 
- rightMagickGeometry
- The 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
- leftMagickGeometry
- The first MagickGeometry to compare. 
- rightMagickGeometry
- The 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
- leftMagickGeometry
- The first MagickGeometry to compare. 
- rightMagickGeometry
- The second MagickGeometry to compare.