Show / Hide Table of Contents

Class Proportions

Represents proportions by image width (X) and height (Y).

Inheritance
object
Proportions
Implements
IProportions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: AdaptiveImages.Core
Assembly: AdaptiveImages.dll
Syntax
public class Proportions : IProportions

Constructors

Proportions(int, int)

Creates a new instance with width and height specified.

Declaration
public Proportions(int width, int height)
Parameters
Type Name Description
int width

Width in pixels.

int height

Height in pixels.

Properties

Ratio

Ratio, effectively width divided by height

Declaration
public double Ratio { get; }
Property Value
Type Description
double

X

Gets the relative width, such as 16 for 16:9 widescreen proportions

Declaration
public int X { get; }
Property Value
Type Description
int

Y

Gets the relative height, such as 9 for 16:9 widescreen proportions

Declaration
public int Y { get; }
Property Value
Type Description
int

Methods

Normalize(int, int)

Normalizes proportions to the smallest factors, for example a size of 1920x1080 produces a ratio of 16:9.

Declaration
public static Proportions Normalize(int width, int height)
Parameters
Type Name Description
int width

Width in pixels.

int height

Height in pixels.

Returns
Type Description
Proportions

Implements

IProportions

Extension Methods

ImageExtensions.GetCultureSpecificImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetImageConstraints<TParent>(TParent, string)
ImageExtensions.GetImageConstraints<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetRequiredImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetSizeConstraint<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
☀
☾
In this article
Back to top
Documentation applies to: Adaptive Images 2.x
☀
☾