Table of Contents

Class SimpleDecoder

Namespace
Imazen.WebP
Assembly
Imazen.WebP.dll

Decodes WebP images into System.Drawing.Bitmap objects. For a cross-platform alternative without System.Drawing, see WebPDecoder.

public class SimpleDecoder
Inheritance
SimpleDecoder
Inherited Members

Constructors

SimpleDecoder()

public SimpleDecoder()

Methods

DecodeFromBytes(byte[], long)

Decodes a WebP image from a byte array into a 32bpp ARGB Bitmap.

public Bitmap DecodeFromBytes(byte[] data, long length)

Parameters

data byte[]

The WebP-encoded data.

length long

Number of bytes to read from the array.

Returns

Bitmap

DecodeFromPointer(nint, long)

Decodes a WebP image from an unmanaged memory pointer into a 32bpp ARGB Bitmap.

public Bitmap DecodeFromPointer(nint data, long length)

Parameters

data nint

Pointer to the WebP-encoded data.

length long

Number of bytes of WebP data.

Returns

Bitmap

DecodeFromStream(Stream)

Decodes a WebP image from a stream, returning a Bitmap. Reads the entire stream into memory first.

public Bitmap DecodeFromStream(Stream stream)

Parameters

stream Stream

Returns

Bitmap

GetDecoderVersion()

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

public static string GetDecoderVersion()

Returns

string