Show / Hide Table of Contents

Class AdaptiveImage

Represents an adaptive image with three form factors.

Inheritance
object
ContentData
BlockData
AdaptiveImage
Implements
IContentData
IInitializableContent
IModifiedTrackable
IReadOnly<BlockData>
IReadOnly
IEquatable<AdaptiveImage>
Inherited Members
BlockData.CreateWritableClone()
ContentData.ResetModified()
ContentData.SetDefaultValues(ContentType)
ContentData.MakeReadOnly()
ContentData.CreateWriteableCloneImplementation()
ContentData.ThrowIfReadOnly()
ContentData.GetValue(string)
ContentData.SetValue(string, object)
ContentData.ContentTypeID
ContentData.Property
ContentData.IsModified
ContentData.IsReadOnly
ContentData.this[string]
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: AdaptiveImages.Models
Assembly: AdaptiveImages.dll
Syntax
[ContentType(GUID = "88f20953-0cec-4aab-a8f4-c164a49ca2c4", AvailableInEditMode = false, GroupName = "AdaptiveImages", Order = 10000)]
[JsonConverter(typeof(AdaptiveImageConverter))]
[JsonConverter(typeof(AdaptiveImageConverter))]
public class AdaptiveImage : BlockData, IContentData, IInitializableContent, IModifiedTrackable, IReadOnly<BlockData>, IReadOnly, IEquatable<AdaptiveImage>
Remarks

Most commonly used for responsive images.

Constructors

AdaptiveImage()

Creates a new AdaptiveImage instance.

Declaration
public AdaptiveImage()

AdaptiveImage(ContentReference)

Creates an adaptive image based on an existing CMS, i.e. ImageData, image.

Declaration
public AdaptiveImage(ContentReference contentReference)
Parameters
Type Name Description
ContentReference contentReference

ContentReference for an ImageData instance.

Remarks

This constructor is primarily intended for fallback scenarios where new AdaptiveImage properties should fall back to existing CMS image properties.

Properties

Large

Gets or sets the image for the desktop (largest) form factor.

Declaration
[Display(Order = 1)]
public virtual SingleImage Large { get; set; }
Property Value
Type Description
SingleImage

Medium

Gets or sets the image for the tablet (medium) form factor.

Declaration
[Display(Order = 2)]
public virtual SingleImage Medium { get; set; }
Property Value
Type Description
SingleImage

Small

Gets or sets the image for the mobile (smallest) form factor.

Declaration
[Display(Order = 3)]
public virtual SingleImage Small { get; set; }
Property Value
Type Description
SingleImage

Methods

Equals(AdaptiveImage?)

Compares two AdaptiveImage instance by validating all form factors are identical, including crop points.

Declaration
public bool Equals(AdaptiveImage? other)
Parameters
Type Name Description
AdaptiveImage other

The other AdaptiveImage instance to compare to.

Returns
Type Description
bool

Equals(object?)

Compares two AdaptiveImage instance by validating all form factors are identical, including crop points.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
object.Equals(object)

Implements

EPiServer.Core.IContentData
EPiServer.Core.IInitializableContent
EPiServer.Core.IModifiedTrackable
EPiServer.Data.Entity.IReadOnly<T>
EPiServer.Data.Entity.IReadOnly
IEquatable<T>

Extension Methods

ImageExtensions.GetCropSettings<TImage, TProperty>(TImage, Expression<Func<TImage, TProperty>>)
ImageExtensions.GetCultureSpecificImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetFormFactor<TImage, TProperty>(TImage, Expression<Func<TImage, TProperty>>)
ImageExtensions.GetImageByFormFactor<T>(T, FormFactor)
ImageExtensions.GetImageByFormFactor<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>, FormFactor)
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>>)
ImageExtensions.IsSet(AdaptiveImage?)
ImageExtensions.ToJson(AdaptiveImage?, Formatting)
ContentExtensions.GetAdaptiveImageProperties(ContentData)
ContentExtensions.GetSingleImageProperties(ContentData)
ImageExtensions.GetSizeConstraint(IContentData, string)
ImageExtensions.GetSizeConstraint(IContentData, string, FormFactor)
☀
☾
In this article
Back to top
Documentation applies to: Adaptive Images 2.x
☀
☾