Table of Contents

Class ImageEncoder

Namespace
SharpDX.WIC
Assembly
SharpDX.Direct2D1.dll
[Guid("04C75BF8-3CE1-473B-ACC5-3CC4F5E94999")]
public class ImageEncoder : ComObject
Inheritance
ImageEncoder

Constructors

ImageEncoder(ImagingFactory2, Device)

Creates a new image encoder object.

public ImageEncoder(ImagingFactory2 factory, Device d2dDevice)

Parameters

factory ImagingFactory2

The WIC factory.

d2dDevice Device

The Device object on which the corresponding image encoder is created.

ImageEncoder(nint)

public ImageEncoder(nint nativePtr)

Parameters

nativePtr nint

Methods

WriteFrame(Image, BitmapFrameEncode, ImageParameters)

Encodes the image to the frame given by the BitmapFrameEncode.

public void WriteFrame(Image imageRef, BitmapFrameEncode frameEncodeRef, ImageParameters imageParametersRef)

Parameters

imageRef Image

No documentation.

frameEncodeRef BitmapFrameEncode

No documentation.

imageParametersRef ImageParameters

No documentation.

Remarks

The image passed in must be created on the same device as in IWICImagingFactory2::CreateImageEncoder. If the pImageParameters are not specified, a set of useful defaults will be assumed, see ImageParameters for more info.

You must correctly and independently have set up the BitmapFrameEncode before calling this API.

WriteFrameThumbnail(Image, BitmapFrameEncode, ImageParameters)

Encodes the image as a thumbnail to the frame given by the BitmapFrameEncode.

public void WriteFrameThumbnail(Image imageRef, BitmapFrameEncode frameEncodeRef, ImageParameters imageParametersRef)

Parameters

imageRef Image

No documentation.

frameEncodeRef BitmapFrameEncode

No documentation.

imageParametersRef ImageParameters

No documentation.

Remarks

The image passed in must be created on the same device as in IWICImagingFactory2::CreateImageEncoder. If the pImageParameters are not specified, a set of useful defaults will be assumed, see ImageParameters for more info.

You must correctly and independently have set up the BitmapFrameEncode before calling this API.

WriteThumbnail(Image, BitmapEncoder, ImageParameters)

Encodes the given image as the thumbnail to the given WIC bitmap encoder.

public void WriteThumbnail(Image imageRef, BitmapEncoder encoderRef, ImageParameters imageParametersRef)

Parameters

imageRef Image

The Direct2D image that will be encoded.

encoderRef BitmapEncoder

The encoder on which the thumbnail is set.

imageParametersRef ImageParameters

Additional parameters to control encoding.

Remarks

You must create the image that you pass in on the same device as in IWICImagingFactory2::CreateImageEncoder. If you don't specify additional parameters in the variable that pImageParameters points to, the encoder uses a set of useful defaults. For info about these defaults, see ImageParameters.

Before you call WriteThumbnail, you must set up the BitmapEncoder interface for the encoder on which you want to set the thumbnail.

If WriteThumbnail fails, it might return E_OUTOFMEMORY, , or other error codes from the encoder.

Operators

explicit operator ImageEncoder(nint)

public static explicit operator ImageEncoder(nint nativePtr)

Parameters

nativePtr nint

Returns

ImageEncoder