skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI UI for Xamarin

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Release History
  • Migrate to .NET MAUI
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Forums
    • Videos
    • Blogs
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class AspectRatio

Represents the aspect ratio expressed as the ratio between the width and height of an image.

Inheritance
System.Object
AspectRatio
Namespace: Telerik.XamarinForms.ImageEditor
Assembly: Telerik.XamarinForms.ImageEditor.dll

Syntax

public sealed class AspectRatio : ValueType, IEquatable<AspectRatio>

Constructors

AspectRatio(Double, Double)

Initializes a new instance of an aspect ratio with the specified components.

Declaration
public AspectRatio(double width, double height)
Parameters
System.Double width

Specifies the width component of the aspect ratio.

System.Double height

Specifies the height component of the aspect ratio.

Fields

Free

Special value, indicating the aspect ratio should not be constrained.

Declaration
public static readonly AspectRatio Free
Field Value
AspectRatio

Original

Special value, indicating the aspect ratio should match the original image.

Declaration
public static readonly AspectRatio Original
Field Value
AspectRatio

Square

Special value, indicating the width and height of the image should be equal.

Declaration
public static readonly AspectRatio Square
Field Value
AspectRatio

Methods

Equals(Object)

Compares the current aspect ratio with the specified object for equality.

Declaration
public override bool Equals(object value)
Parameters
System.Object value

Specifies the object value for comparison.

Returns
System.Boolean

True, if the two objects are equal, false otherwise.

Equals(AspectRatio)

Compares the current aspect ratio with the specified one for equality.

Declaration
public bool Equals(AspectRatio aspectRatio)
Parameters
AspectRatio aspectRatio

Specifies the aspect ratio for comparison.

Returns
System.Boolean

True, if the two aspect ratios are equal, false otherwise.

GetHashCode()

Computes the hash code of the current aspect ratio.

Declaration
public override int GetHashCode()
Returns
System.Int32

Parse(String)

Parses the specified string and converts it to an aspect ratio.

Declaration
public static AspectRatio Parse(string text)
Parameters
System.String text

Specifies the input string to parse.

Returns
AspectRatio

The converted aspect ratio on success.

Exceptions
System.FormatException

If the specified string cannot be parsed.

ToDouble()

Converts the current aspect ratio to its floating-point representation.

Declaration
public double ToDouble()
Returns
System.Double

ToString()

Converts the current aspect ratio to its string representation.

Declaration
public override string ToString()
Returns
System.String

TryParse(String, out AspectRatio)

Parses the specified string and converts it to an aspect ratio.

Declaration
public static bool TryParse(string text, out AspectRatio aspectRatio)
Parameters
System.String text

Specifies the input string to parse.

AspectRatio aspectRatio

Returns the converted aspect ratio on success.

Returns
System.Boolean

True, if the parse operation is successful, false otherwise.

Operators

Equality(AspectRatio, AspectRatio)

Compares the specified two aspect ratios for equality.

Declaration
public static bool operator ==(AspectRatio leftOperand, AspectRatio rightOperand)
Parameters
AspectRatio leftOperand

Specifies the left operand for the comparison.

AspectRatio rightOperand

Specifies the right operand for the comparison.

Returns
System.Boolean

True, if the two aspect ratios are equal, false otherwise.

Explicit(AspectRatio to Double)

Converts the specified aspect ratio to its floating-point representation.

Declaration
public static explicit operator double (AspectRatio aspectRatio)
Parameters
AspectRatio aspectRatio

Specifies the aspect ratio to convert.

Returns
System.Double

Inequality(AspectRatio, AspectRatio)

Compares the specified two aspect ratios for inequality.

Declaration
public static bool operator !=(AspectRatio leftOperand, AspectRatio rightOperand)
Parameters
AspectRatio leftOperand

Specifies the left operand for the comparison.

AspectRatio rightOperand

Specifies the right operand for the comparison.

Returns
System.Boolean

True, if the two aspect ratios are not equal, false otherwise.

Sample Applications
  • Telerik Tagit
  • iOS Demo App
  • Android Demo App
Support Resources
  • iOS Wrappers
  • Android Wrappers
  • Xamarin.Forms SDK Examples
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.