BitmapSourceExtensionsGetReadableBitmapData(BitmapSource, Color, Byte) Method
Namespace: KGySoft.Drawing.WpfAssembly: KGySoft.Drawing.Wpf (in KGySoft.Drawing.Wpf.dll) Version: 8.1.0
public static IReadableBitmapData GetReadableBitmapData(
this BitmapSource bitmap,
Color backColor = default,
byte alphaThreshold = 128
)
<ExtensionAttribute>
Public Shared Function GetReadableBitmapData (
bitmap As BitmapSource,
Optional backColor As Color = Nothing,
Optional alphaThreshold As Byte = 128
) As IReadableBitmapData
public:
[ExtensionAttribute]
static IReadableBitmapData^ GetReadableBitmapData(
BitmapSource^ bitmap,
Color backColor = Color(),
unsigned char alphaThreshold = 128
)
[<ExtensionAttribute>]
static member GetReadableBitmapData :
bitmap : BitmapSource *
?backColor : Color *
?alphaThreshold : byte
(* Defaults:
let _backColor = defaultArg backColor new Color()
let _alphaThreshold = defaultArg alphaThreshold 128
*)
-> IReadableBitmapData
- bitmap BitmapSource
- A BitmapSource instance, whose data is about to be accessed.
- backColor Color (Optional)
- For an IReadableBitmapData instance the backColor is relevant only for indexed bitmaps
when GetNearestColorIndex and GetNearestColor methods
are called with an alpha color on the Palette property. Queried colors with alpha, which are considered opaque will be blended
with this color before performing a lookup. The alpha value (Color.A property) of the specified 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)
- Similarly to backColor, for an IReadableBitmapData instance the alphaThreshold is relevant
only for indexed bitmaps when GetNearestColorIndex and GetNearestColor methods
are called with an alpha color on the Palette property. In such case determines the lowest alpha value of a color,
which should not be considered as transparent. If 0, then a color lookup will never return a transparent color. This parameter is optional.
Default value: 128.
IReadableBitmapDataAn
IReadableBitmapData instance, which provides fast read-only access to the actual data of the specified
bitmap.In Visual Basic and C#, you can call this method as an instance method on any object of type
BitmapSource. 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).