Class WebMediaFormat
A WebMediaFormat will keep the source format (image, audio, video) if possible but allow resize operations
Inheritance
Inherited Members
Namespace: ImageVault.Common.Data
Assembly: ImageVault.Common.dll
Syntax
public class WebMediaFormat : TransformableFormat, IMediaFormat, IItem<int>, IResizeFormat
Remarks
2011-12-01 dan: Created
Constructors
WebMediaFormat()
Initializes a new instance of the WebMediaFormat class.
Declaration
public WebMediaFormat()
WebMediaFormat(WebMediaFormat)
Initializes a new instance of the WebMediaFormat class.
Declaration
public WebMediaFormat(WebMediaFormat format)
Parameters
Type | Name | Description |
---|---|---|
WebMediaFormat | format |
Properties
AspectRatio
Get/Sets the AspectRatio of the MediaConversion
Declaration
public double AspectRatio { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Defines the aspect ratio of the image. If set the original image will automatically cropped to a size that matches the given aspect ratio (unless the original image already matches the given aspect ratio). Default value is zero. Zero disables the crop function, negative values are illegal. |
Height
Get/Sets the Height of the MediaConversion
Declaration
public Nullable<int> Height { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> | Defines the maximum height of the image |
IsEmpty
Checks if this is an empty format or not
Declaration
public override bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
KeepAspectRatio
Get/Sets the KeepAspectRatio of the MediaConversion
Declaration
public bool KeepAspectRatio { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Will keep the original aspect ratio of the image if set to true. If false the image will be the aspect ratio of the target size. Default value is true |
Remarks
If the AspectRatio is set to anything else than zero, this value has no function since the aspect ratio is already set.
Width
Get/Sets the Width of the MediaConversion
Declaration
public Nullable<int> Width { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> | Defines the maximum width of the image |
Methods
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public override MediaFormatBase Clone()
Returns
Type | Description |
---|---|
MediaFormatBase | A new object that is a copy of this instance. |
Overrides
CopyFrom(WebMediaFormat)
Copies the information from the supplied format to the current instance
Declaration
protected void CopyFrom(WebMediaFormat format)
Parameters
Type | Name | Description |
---|---|---|
WebMediaFormat | format | The WebMediaFormat to copy from |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Equals(WebMediaFormat)
Determines whether the specified WebMediaFormat is equal to the current WebMediaFormat.
Declaration
public bool Equals(WebMediaFormat other)
Parameters
Type | Name | Description |
---|---|---|
WebMediaFormat | other | The WebMediaFormat to compare with the current WebMediaFormat. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified WebMediaFormat is equal to the current WebMediaFormat; otherwise, false. |
Equals(Object)
Determines whether the specified System.Object is equal to the current System.Object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified System.Object is equal to the current System.Object; otherwise, false. |
Overrides
GetHashCode()
Serves as a hash function for a particular type.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current System.Object. |