Class ImageFileViewModel
- Namespace
- Dynamicweb.Frontend
- Assembly
- Dynamicweb.dll
public sealed class ImageFileViewModel : FileViewModel
- Inheritance
-
ImageFileViewModel
- Inherited Members
- Extension Methods
Properties
FocalX
Gets or sets the x axis focal point.
public int FocalX { get; set; }
Property Value
- int
A number between -100 and 100 that tells in percent how far from the middle of the image the focal point is on the x-axis
Remarks
Negative numbers are left of the middle, positive right of the middle
FocalY
Gets or sets the y axis focal point.
public int FocalY { get; set; }
Property Value
- int
A number between -100 and 100 that tells in percent how far from the middle of the image the focal point is on the y-axis
Remarks
Negative numbers are below the middle, positive above the middle
Ratio
Gets or sets the aspect ratio.
public string? Ratio { get; set; }
Property Value
- string
The ratio of the image width to its height, i.e. 1/1, 3/4, 16/9.
Methods
FocalPositionFromLeft()
Gets the focal points position from the left edge of the image in percentage.
public int FocalPositionFromLeft()
Returns
- int
A number between 0 and 100 that tells in percent how far from the left of the image the focal point is on the x-axis (horizontal)
FocalPositionFromTop()
Gets the focal points position from the top edge of the image in percentage.
public int FocalPositionFromTop()
Returns
- int
A number between 0 and 100 that tells in percent how far from the top of the image the focal point is on the y-axis (vertical)
GetFocalPointParameters()
Returns a focal point parameter string for use with GetImage.ashx.
public string GetFocalPointParameters()
Returns
- string
If HasFocalPoint() is true, the return is a strings of the following structure "x=FocalX&y=FocalY" Otherwise the return is Empty.
Remarks
Returns focal point in the format: x=75&y=23 If focal points are not defined (if they are both 0) this method returns an empty string.
GetFocalPointPercentage()
Returns a focal percentage parameter string, based on FocalPositionFromLeft() FocalPositionFromTop().
public string GetFocalPointPercentage()
Returns
- string
If HasFocalPoint() is true, the return is a string of the following structure "FocalPositionFromLeft() FocalPositionFromTop()%" Otherwise the return is Empty.
Remarks
Returns focal point percentage in the format: 75% 25% If focal points are not defined (if they are both 0) this method returns an empty string.
HasFocalPoint()
Detects if the current image has at least one focal point set.
public bool HasFocalPoint()
Returns
- bool
Boolean as true if focal point exists, and false if it doesn't.