BitmapExtensionsGetReadableBitmapData(Bitmap, WorkingColorSpace, Color, Byte) Method
Namespace: KGySoft.DrawingAssembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 9.0.0
public static IReadableBitmapData GetReadableBitmapData(
this Bitmap bitmap,
WorkingColorSpace workingColorSpace,
Color backColor = default,
byte alphaThreshold = 128
)
<ExtensionAttribute>
Public Shared Function GetReadableBitmapData (
bitmap As Bitmap,
workingColorSpace As WorkingColorSpace,
Optional backColor As Color = Nothing,
Optional alphaThreshold As Byte = 128
) As IReadableBitmapData
public:
[ExtensionAttribute]
static IReadableBitmapData^ GetReadableBitmapData(
Bitmap^ bitmap,
WorkingColorSpace workingColorSpace,
Color backColor = Color(),
unsigned char alphaThreshold = 128
)
[<ExtensionAttribute>]
static member GetReadableBitmapData :
bitmap : Bitmap *
workingColorSpace : WorkingColorSpace *
?backColor : Color *
?alphaThreshold : byte
(* Defaults:
let _backColor = defaultArg backColor new Color()
let _alphaThreshold = defaultArg alphaThreshold 128
*)
-> IReadableBitmapData
- bitmap Bitmap
- A Bitmap instance, whose data is about to be accessed.
- workingColorSpace WorkingColorSpace
- Specifies the preferred color space that should be used when working with the result bitmap data. Determines the behavior
of some operations such as resizing or looking up for nearest colors if bitmap has an indexed pixel format.
See the Remarks section of the WorkingColorSpace enumeration for more details. - backColor Color (Optional)
- Just like workingColorSpace, 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: Color.Empty, 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
Bitmap. 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).