Table of Contents

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
IMagickGeometry
IEquatable<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

percentageWidth Percentage

The percentage of the width.

percentageHeight Percentage

The 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

widthAndHeight int

The 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

width int

The width.

height int

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

x int

The X offset from origin.

y int

The Y offset from origin.

percentageWidth Percentage

The percentage of the width.

percentageHeight Percentage

The 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

x int

The X offset from origin.

y int

The Y offset from origin.

width int

The width.

height int

The height.

MagickGeometry(string)

Initializes a new instance of the MagickGeometry class using the specified geometry.

public MagickGeometry(string value)

Parameters

value string

Geometry 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

bool

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

bool

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

bool

Height

Gets or sets the height of the geometry.

public int Height { get; set; }

Property Value

int

IgnoreAspectRatio

Gets or sets a value indicating whether the image is resized without preserving aspect ratio (!).

public bool IgnoreAspectRatio { get; set; }

Property Value

bool

IsPercentage

Gets or sets a value indicating whether the width and height are expressed as percentages.

public bool IsPercentage { get; set; }

Property Value

bool

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

bool

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

bool

Width

Gets or sets the width of the geometry.

public int Width { get; set; }

Property Value

int

X

Gets or sets the X offset from origin.

public int X { get; set; }

Property Value

int

Y

Gets or sets the Y offset from origin.

public int Y { get; set; }

Property Value

int

Methods

CompareTo(IMagickGeometry?)

Compares the current instance with another object of the same type.

public int CompareTo(IMagickGeometry? other)

Parameters

other IMagickGeometry

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

other IMagickGeometry

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

obj object

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

pageSize string

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, int, int)

Initializes the geometry using the specified value.

public void Initialize(int x, int y, int width, int height)

Parameters

x int

The X offset from origin.

y int

The Y offset from origin.

width int

The width.

height int

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

left MagickGeometry

The first MagickGeometry to compare.

right MagickGeometry

The second MagickGeometry to compare.

Returns

bool

explicit operator MagickGeometry(string)

Converts the specified string to an instance of this type.

public static explicit operator MagickGeometry(string value)

Parameters

value string

Geometry specifications in the form: <width>x<height> {+-}<xoffset>{+-}<yoffset> (where width, height, xoffset, and yoffset are numbers).

Returns

MagickGeometry

operator >(MagickGeometry, MagickGeometry)

Determines whether the first MagickGeometry is more than the second MagickGeometry.

public static bool operator >(MagickGeometry left, MagickGeometry right)

Parameters

left MagickGeometry

The first MagickGeometry to compare.

right MagickGeometry

The second MagickGeometry to compare.

Returns

bool

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

left MagickGeometry

The first MagickGeometry to compare.

right MagickGeometry

The second MagickGeometry to compare.

Returns

bool

operator !=(MagickGeometry, MagickGeometry)

Determines whether the specified MagickGeometry instances are not considered equal.

public static bool operator !=(MagickGeometry left, MagickGeometry right)

Parameters

left MagickGeometry

The first MagickGeometry to compare.

right MagickGeometry

The second MagickGeometry to compare.

Returns

bool

operator <(MagickGeometry, MagickGeometry)

Determines whether the first MagickGeometry is less than the second MagickGeometry.

public static bool operator <(MagickGeometry left, MagickGeometry right)

Parameters

left MagickGeometry

The first MagickGeometry to compare.

right MagickGeometry

The second MagickGeometry to compare.

Returns

bool

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

left MagickGeometry

The first MagickGeometry to compare.

right MagickGeometry

The second MagickGeometry to compare.

Returns

bool