AspectRatio
Represents the aspect ratio expressed as the ratio between the width and height of an image.
Definition
Namespace:Telerik.Maui.Controls.ImageEditor
Assembly:Telerik.Maui.Controls.dll
Syntax:
[TypeConverter(typeof(AspectRatioConverter))]
public struct AspectRatio : IEquatable<AspectRatio>
Implements:
Constructors
Fields
Special value, indicating the aspect ratio should not be constrained.
public static readonly AspectRatio Free
Special value, indicating the aspect ratio should match the original image.
public static readonly AspectRatio Original
Special value, indicating the width and height of the image should be equal.
public static readonly AspectRatio Square
Methods
Compares the current aspect ratio with the specified one for equality.
public bool Equals(AspectRatio aspectRatio)
Specifies the aspect ratio for comparison.
Returns:True, if the two aspect ratios are equal, false otherwise.
Implements:
Computes the hash code of the current aspect ratio.
Parses the specified string and converts it to an aspect ratio.
public static AspectRatio Parse(string text)
Specifies the input string to parse.
Returns:The converted aspect ratio on success.
Exceptions:If the specified string cannot be parsed.
Converts the current aspect ratio to its floating-point representation.
Converts the current aspect ratio to its string representation.
Parses the specified string and converts it to an aspect ratio.
public static bool TryParse(string text, out AspectRatio aspectRatio)
Specifies the input string to parse.
aspectRatioAspectRatioReturns the converted aspect ratio on success.
Returns:True, if the parse operation is successful, false otherwise.
Operators
Converts the specified aspect ratio to its floating-point representation.
public static explicit operator double(AspectRatio aspectRatio)
Specifies the aspect ratio to convert.
Returns:Compares the specified two aspect ratios for inequality.
public static bool operator !=(AspectRatio leftOperand, AspectRatio rightOperand)
Specifies the left operand for the comparison.
rightOperandAspectRatioSpecifies the right operand for the comparison.
Returns:True, if the two aspect ratios are not equal, false otherwise.
Compares the specified two aspect ratios for equality.
public static bool operator ==(AspectRatio leftOperand, AspectRatio rightOperand)
Specifies the left operand for the comparison.
rightOperandAspectRatioSpecifies the right operand for the comparison.
Returns:True, if the two aspect ratios are equal, false otherwise.