View Source
Class ImageCropperValue
Represents a value of the image cropper value editor.
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
[TypeConverter(typeof(ImageCropperValueTypeConverter))]
[DataContract(Name = "imageCropDataSet")]
public class ImageCropperValue : IHtmlString, IEquatable<ImageCropperValue>
Properties
View Source
Crops
Gets or sets the value crops.
Declaration
[DataMember(Name = "crops")]
public IEnumerable<ImageCropperValue.ImageCropperCrop> Crops { get; set; }
Property Value
View Source
FocalPoint
Gets or sets the value focal point.
Declaration
[DataMember(Name = "focalPoint")]
public ImageCropperValue.ImageCropperFocalPoint FocalPoint { get; set; }
Property Value
View Source
Src
Gets or sets the value source image.
Declaration
[DataMember(Name = "src")]
public string Src { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
Equals(ImageCropperValue)
Declaration
public bool Equals(ImageCropperValue other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
View Source
GetCrop(String)
Declaration
public ImageCropperValue.ImageCropperCrop GetCrop(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
Returns
View Source
GetCropUrl(Int32, Int32, Boolean, String)
Gets the value image URL for a specific width and height.
Declaration
[Obsolete("Use the overload that takes an IImageUrlGenerator")]
public string GetCropUrl(int width, int height, bool useFocalPoint = false, string cacheBusterValue = null)
Parameters
Type |
Name |
Description |
System.Int32 |
width |
|
System.Int32 |
height |
|
System.Boolean |
useFocalPoint |
|
System.String |
cacheBusterValue |
|
Returns
Type |
Description |
System.String |
|
View Source
GetCropUrl(Int32, Int32, IImageUrlGenerator, Boolean, String)
Gets the value image URL for a specific width and height.
Declaration
public string GetCropUrl(int width, int height, IImageUrlGenerator imageUrlGenerator, bool useFocalPoint = false, string cacheBusterValue = null)
Parameters
Type |
Name |
Description |
System.Int32 |
width |
|
System.Int32 |
height |
|
IImageUrlGenerator |
imageUrlGenerator |
|
System.Boolean |
useFocalPoint |
|
System.String |
cacheBusterValue |
|
Returns
Type |
Description |
System.String |
|
View Source
GetCropUrl(String, Boolean, Boolean, String)
Gets the value image URL for a specified crop.
Declaration
[Obsolete("Use the overload that takes an IImageUrlGenerator")]
public string GetCropUrl(string alias, bool useCropDimensions = true, bool useFocalPoint = false, string cacheBusterValue = null)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
System.Boolean |
useCropDimensions |
|
System.Boolean |
useFocalPoint |
|
System.String |
cacheBusterValue |
|
Returns
Type |
Description |
System.String |
|
View Source
GetCropUrl(String, IImageUrlGenerator, Boolean, Boolean, String)
Gets the value image URL for a specified crop.
Declaration
public string GetCropUrl(string alias, IImageUrlGenerator imageUrlGenerator, bool useCropDimensions = true, bool useFocalPoint = false, string cacheBusterValue = null)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
IImageUrlGenerator |
imageUrlGenerator |
|
System.Boolean |
useCropDimensions |
|
System.Boolean |
useFocalPoint |
|
System.String |
cacheBusterValue |
|
Returns
Type |
Description |
System.String |
|
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
View Source
HasCrop(String)
Determines whether the value has a specified crop.
Declaration
public bool HasCrop(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
HasCrops()
Determines whether the value has crops.
Declaration
Returns
Type |
Description |
System.Boolean |
|
View Source
HasFocalPoint()
Determines whether the value has a focal point.
Declaration
public bool HasFocalPoint()
Returns
Type |
Description |
System.Boolean |
|
View Source
HasImage()
Determines whether the value has a source image.
Declaration
Returns
Type |
Description |
System.Boolean |
|
View Source
Prune(JObject)
Removes redundant crop data/default focal point.
Declaration
public static void Prune(JObject value)
Parameters
Type |
Name |
Description |
JObject |
value |
The image cropper value.
|
View Source
ToHtmlString()
Declaration
public string ToHtmlString()
Returns
Type |
Description |
System.String |
|
View Source
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Operators
View Source
Equality(ImageCropperValue, ImageCropperValue)
Declaration
public static bool operator ==(ImageCropperValue left, ImageCropperValue right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
View Source
Inequality(ImageCropperValue, ImageCropperValue)
Declaration
public static bool operator !=(ImageCropperValue left, ImageCropperValue right)
Parameters
Returns
Type |
Description |
System.Boolean |
|