Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.8.10
IWICLeadBitmapEncoder::GetDitherTypes Method
See Also

Gets the valid dithering type options for the LEAD Bitmap Encoder.

Syntax

 
HRESULT GetDitherTypes(      
    GUID guidPixelFormat,     UINT cbSizeDitherTypes,     WICLeadDitherType *pDitherTypes, UINT *pcDitherTypes );

Parameters

 
guidPixelFormat
[in] The pixel format GUID that the encoder is using.
cbSizeDitherTypes
[in] The array size of the pDitherTypes array.
pDitherTypes
[in,out] A pointer that receives a list of dithering types supported by the encoder.
pcDitherTypes
[in,out] A pointer that receives the number of dithering types the encoder supports.

Return Values

Returns S_OK if successful, or an error value otherwise.

Remarks

Whenever you reduce an image's color resolution to 8 bits per pixel or less, a dithering method comes into play. One alternative is to use a nearest-color match (no dithering), which means that the color of each pixel is changed to the palette color that most closely matches it. If the original image contains subtle color details, the result of a nearest-color match may have large blotches of color that are not very pleasing. Dithering methods create the appearance of more subtle shades by mixing in pixels of different colors. This is similar to the way newspaper pictures produce the appearance of shades of gray, even though the only actual colors are black and white.

Any LEAD Bitmap Encoder that can write image data at 8 bits per pixel or less will have a DitherType property bag item. Call the IWICLeadBitmapEncoder::GetDitherTypes method to fill an array with the valid dithering types for particular the LEAD bitmap encoder.  Call GetDitherTypes once to get the number of sub-formats.  Allocate the appropriately sized array.  Then call GetDitherTypes again, passing the allocated array as an argument.  Any of the WICLeadDitherType values returned by GetDitherTypes can be used as a value for the DitherType property bag item.

The friendly name for the dithering type can be obtained by calling the GetDitherTypeFriendlyName method.
See WICLeadDitherType for a description of the dithering methods.

See Also

Example