PixelFormatExtensionsGetMatchingQuantizer Method
Gets a
PredefinedColorsQuantizer instance that fits for the specified
pixelFormat.
For indexed formats a default palette will be used.
Namespace: KGySoft.Drawing.WpfAssembly: KGySoft.Drawing.Wpf (in KGySoft.Drawing.Wpf.dll) Version: 10.0.0-rc.1
public static PredefinedColorsQuantizer GetMatchingQuantizer(
this PixelFormat pixelFormat,
Color backColor = default,
byte alphaThreshold = 128
)
<ExtensionAttribute>
Public Shared Function GetMatchingQuantizer (
pixelFormat As PixelFormat,
Optional backColor As Color = Nothing,
Optional alphaThreshold As Byte = 128
) As PredefinedColorsQuantizer
public:
[ExtensionAttribute]
static PredefinedColorsQuantizer^ GetMatchingQuantizer(
PixelFormat pixelFormat,
Color backColor = Color(),
unsigned char alphaThreshold = 128
)
[<ExtensionAttribute>]
static member GetMatchingQuantizer :
pixelFormat : PixelFormat *
?backColor : Color *
?alphaThreshold : byte
(* Defaults:
let _backColor = defaultArg backColor new Color()
let _alphaThreshold = defaultArg alphaThreshold 128
*)
-> PredefinedColorsQuantizer
- pixelFormat PixelFormat
- The PixelFormat to get a quantizer for.
- backColor Color (Optional)
- Colors with alpha (transparency), which are considered opaque will be blended with this color before quantization.
The Color.A property of the background color is ignored. This parameter is optional.
Default value: The bitwise zero instance of Color, which has the same RGB values as Black. - alphaThreshold Byte (Optional)
- Specifies a threshold value for the Color.A property,
under which a quantized color is considered completely transparent. This parameter is optional.
Default value: 128.
PredefinedColorsQuantizerA
PredefinedColorsQuantizer instance that is compatible with the specified
pixelFormat.In Visual Basic and C#, you can call this method as an instance method on any object of type
PixelFormat. 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).