BitmapDataExtensionsDither(IReadWriteBitmapData, IQuantizer, IDitherer) Method
Quantizes an
IReadWriteBitmapData with dithering (reduces the number of colors while trying to preserve details)
using the specified
quantizer and
ditherer.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.2.0
public static void Dither(
this IReadWriteBitmapData bitmapData,
IQuantizer quantizer,
IDitherer ditherer
)
<ExtensionAttribute>
Public Shared Sub Dither (
bitmapData As IReadWriteBitmapData,
quantizer As IQuantizer,
ditherer As IDitherer
)
public:
[ExtensionAttribute]
static void Dither(
IReadWriteBitmapData^ bitmapData,
IQuantizer^ quantizer,
IDitherer^ ditherer
)
[<ExtensionAttribute>]
static member Dither :
bitmapData : IReadWriteBitmapData *
quantizer : IQuantizer *
ditherer : IDitherer -> unit
- bitmapData IReadWriteBitmapData
- An IReadWriteBitmapData instance to be quantized.
- quantizer IQuantizer
- An IQuantizer implementation to be used for quantizing the specified bitmapData.
- ditherer IDitherer
- An IDitherer implementation to be used for dithering during the quantization of the specified bitmapData.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IReadWriteBitmapData. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. You can use
the
Dither(IReadWriteBitmapData, IQuantizer, IDitherer, ParallelConfig) overload to configure these, while still executing the method synchronously. Alternatively, use
the
BeginDither or
DitherAsync (in .NET Framework 4.0 and above) methods to perform the operation asynchronously.
This method quantizes bitmapData with dithering in place (its original content will be overwritten). To return a new instance
use the Clone extension method instead.
If the KnownPixelFormat or the palette of bitmapData is not compatible with the colors of the specified quantizer, then
the result may not be correct.
If bitmapData has already the same set of colors that the specified quantizer, then it can happen
that calling this method does not change bitmapData at all.