Class ImageEncoder

Definition

Namespace:
Tizen.Multimedia.Util
Assembly:
Tizen.Multimedia.Util.dll
API Level:
4

This is a base class for image encoders.

C#
Copy
public abstract class ImageEncoder : IDisposable
Inheritance
ImageEncoder
Derived
Tizen.Multimedia.Util.JpegXlEncoder
Tizen.Multimedia.Util.JpegXlEncoder
Tizen.Multimedia.Util.WebPEncoder
Tizen.Multimedia.Util.WebPEncoder
Tizen.Multimedia.Util.WebPEncoder
Tizen.Multimedia.Util.WebPEncoder
Implements
System.IDisposable

Properties

View Source

OutputFormat

Gets the image format of this encoder.

Declaration
C#
Copy
public ImageFormat OutputFormat { get; }
Property Value
Type Description
ImageFormat
API Level: 4

Methods

View Source

Dispose()

Releases all resources used by the ImageEncoder.

Declaration
C#
Copy
public void Dispose()
API Level: 4
View Source

Dispose(Boolean)

Releases the unmanaged resources used by the ImageEncoder.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

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

API Level: 4
View Source

EncodeAsync(Byte[], Stream)

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

Declaration
C#
Copy
public Task EncodeAsync(byte[] inputBuffer, Stream outStream)
Parameters
Type Name Description
System.Byte[] inputBuffer

The image buffer to encode.

Stream outStream

The stream that the image is encoded to.

Returns
Type Description
Task

A task that represents the asynchronous encoding operation.

Exceptions
Type Condition
ArgumentNullException

inputBuffer is null.
-or-
outStream is null.

System.ArgumentException

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

InvalidOperationException

The resolution is not set.

ObjectDisposedException

The ImageEncoder has already been disposed of.

API Level: 4
View Source

SetColorSpace(ColorSpace)

Sets the color-space of the output image.

Declaration
C#
Copy
public void SetColorSpace(ColorSpace colorSpace)
Parameters
Type Name Description
ColorSpace colorSpace

The target color-space.

Exceptions
Type Condition
System.ArgumentException

colorSpace is invalid.

System.NotSupportedException

colorSpace is not supported by the encoder.

API Level: 4
View Source

SetResolution(Size)

Sets the resolution of the output image.

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

The target resolution.

Exceptions
Type Condition
ArgumentOutOfRangeException

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

API Level: 4

Implements

System.IDisposable