Class ImageEncoder
[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
ImagingFactory2The WIC factory.
d2dDevice
DeviceThe 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
ImageNo documentation.
frameEncodeRef
BitmapFrameEncodeNo documentation.
imageParametersRef
ImageParametersNo 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
ImageNo documentation.
frameEncodeRef
BitmapFrameEncodeNo documentation.
imageParametersRef
ImageParametersNo 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
ImageThe Direct2D image that will be encoded.
encoderRef
BitmapEncoderThe encoder on which the thumbnail is set.
imageParametersRef
ImageParametersAdditional 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,
Operators
explicit operator ImageEncoder(nint)
public static explicit operator ImageEncoder(nint nativePtr)
Parameters
nativePtr
nint