Class ImageEncoder

    Definition

    Namespace:
    Tizen.Multimedia.Util
    Assembly:
    Tizen.Multimedia.Util.dll

    This is a base class for image encoders.

    public abstract class ImageEncoder : IDisposable
    Inheritance
    object
    ImageEncoder
    Derived
    BmpEncoder
    BmpEncoder
    GifEncoder
    GifEncoder
    JpegEncoder
    JpegEncoder
    JpegXlEncoder
    JpegXlEncoder
    PngEncoder
    PngEncoder
    WebPEncoder
    WebPEncoder
    Implements
    System.IDisposable

    Properties

    View Source

    OutputFormat

    Gets the image format of this encoder.

    Declaration
    public ImageFormat OutputFormat { get; }
    Property Value
    Type Description
    ImageFormat

    Methods

    View Source

    Dispose()

    Releases all resources used by the ImageEncoder.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Releases the unmanaged resources used by the ImageEncoder.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    View Source

    EncodeAsync(byte[], Stream)

    Encodes an image from a raw image buffer to a specified System.IO.Stream.

    Declaration
    public Task EncodeAsync(byte[] inputBuffer, Stream outStream)
    Parameters
    Type Name Description
    byte[] inputBuffer

    The image buffer to encode.

    System.IO.Stream outStream

    The stream that the image is encoded to.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A task that represents the asynchronous encoding operation.

    Exceptions
    Type Condition
    System.ArgumentNullException

    inputBuffer is null.
    -or-
    outStream is null.

    System.ArgumentException

    inputBuffer is an empty array.
    -or-
    outStream is not writable.

    System.InvalidOperationException

    The resolution is not set.

    System.ObjectDisposedException

    The ImageEncoder has already been disposed of.

    See Also
    SetResolution(Size)
    View Source

    SetColorSpace(ColorSpace)

    Declaration
    public void SetColorSpace(ColorSpace colorSpace)
    Parameters
    Type Name Description
    ColorSpace colorSpace
    View Source

    SetResolution(Size)

    Sets the resolution of the output image.

    Declaration
    public void SetResolution(Size resolution)
    Parameters
    Type Name Description
    Size resolution

    The target resolution.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    The width of resolution is less than or equal to zero.
    -or-
    The height of resolution is less than or equal to zero.

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX