Table of Contents

Class SimpleEncoder

Namespace
Imazen.WebP
Assembly
Imazen.WebP.dll

Encodes Bitmap objects into WebP format

public class SimpleEncoder
Inheritance
SimpleEncoder
Inherited Members

Constructors

SimpleEncoder()

public SimpleEncoder()

Methods

Encode(Bitmap, Stream, WebPEncoderConfig)

Encodes the given RGB(A) bitmap using advanced WebPEncoderConfig settings. Uses the full WebPPicture/WebPConfig pipeline for maximum control.

public void Encode(Bitmap b, Stream to, WebPEncoderConfig config)

Parameters

b Bitmap
to Stream
config WebPEncoderConfig

Encode(Bitmap, Stream, float)

Encodes the given RGB(A) bitmap to the given stream. Specify quality = -1 for lossless, otherwise specify a value between 0 and 100.

public void Encode(Bitmap from, Stream to, float quality)

Parameters

from Bitmap
to Stream
quality float

Encode(Bitmap, Stream, float, bool)

Encodes the given RGB(A) bitmap to the given stream. Specify quality = -1 for lossless, otherwise specify a value between 0 and 100.

[Obsolete("Use Encode(Bitmap, Stream, float) instead")]
public void Encode(Bitmap from, Stream to, float quality, bool noAlpha)

Parameters

from Bitmap
to Stream
quality float
noAlpha bool

Encode(Bitmap, float, bool, out nint, out long)

Encodes the given RGB(A) bitmap to an unmanaged memory buffer. Specify quality = -1 for lossless, otherwise specify a value between 0 and 100.

[Obsolete("Use Encode(Bitmap, float, out IntPtr, out long) instead")]
public void Encode(Bitmap b, float quality, bool noAlpha, out nint result, out long length)

Parameters

b Bitmap
quality float
noAlpha bool
result nint
length long

Encode(Bitmap, float, out nint, out long)

Encodes the given RGB(A) bitmap to an unmanaged memory buffer. Specify quality = -1 for lossless, otherwise specify a value between 0 and 100.

public void Encode(Bitmap b, float quality, out nint result, out long length)

Parameters

b Bitmap
quality float
result nint
length long

GetEncoderVersion()

Returns the version string of the loaded native libwebp encoder (e.g. "1.5.0").

public static string GetEncoderVersion()

Returns

string