Search Results for

    Show / Hide Table of Contents

    Class WebMediaFormat

    A WebMediaFormat will keep the source format (image, audio, video) if possible but allow resize operations

    Inheritance
    System.Object
    MediaFormatBase
    TransformableFormat
    WebMediaFormat
    ThumbnailFormat
    ThumbnailFormat
    VideoFormat
    VideoFormat
    Implements
    IMediaFormat
    IItem<System.Int32>
    System.ICloneable
    IResizeFormat
    Inherited Members
    TransformableFormat.CopyFrom(TransformableFormat)
    TransformableFormat.Equals(TransformableFormat)
    TransformableFormat.Effects
    MediaFormatBase.CopyFrom(MediaFormatBase)
    MediaFormatBase.Equals(MediaFormatBase)
    MediaFormatBase.Id
    MediaFormatBase.Name
    MediaFormatBase.MediaFormatOutputType
    MediaFormatBase.SystemFormat
    MediaFormatBase.IsInUse
    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
    TransformableFormat.IsEmpty

    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
    MediaFormatBase.Clone()

    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 format is null.

    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
    TransformableFormat.Equals(Object)

    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.

    Overrides
    TransformableFormat.GetHashCode()

    Implements

    IMediaFormat
    IItem<T>
    System.ICloneable
    IResizeFormat

    Extension Methods

    MediaFormatBaseExtensions.GetEffect<T>(MediaFormatBase)
    EnumExtensions.GetNames<TEnum>(TEnum)
    In This Article
    Back to top (c) Meriworks 2002-2022