WriteableBitmapExtensionsGetWritableBitmapData(WriteableBitmap, WorkingColorSpace, Color, Byte) Method
Namespace: KGySoft.Drawing.WpfAssembly: KGySoft.Drawing.Wpf (in KGySoft.Drawing.Wpf.dll) Version: 9.0.0
public static IWritableBitmapData GetWritableBitmapData(
this WriteableBitmap bitmap,
WorkingColorSpace workingColorSpace,
Color backColor = default,
byte alphaThreshold = 128
)
<ExtensionAttribute>
Public Shared Function GetWritableBitmapData (
bitmap As WriteableBitmap,
workingColorSpace As WorkingColorSpace,
Optional backColor As Color = Nothing,
Optional alphaThreshold As Byte = 128
) As IWritableBitmapData
public:
[ExtensionAttribute]
static IWritableBitmapData^ GetWritableBitmapData(
WriteableBitmap^ bitmap,
WorkingColorSpace workingColorSpace,
Color backColor = Color(),
unsigned char alphaThreshold = 128
)
[<ExtensionAttribute>]
static member GetWritableBitmapData :
bitmap : WriteableBitmap *
workingColorSpace : WorkingColorSpace *
?backColor : Color *
?alphaThreshold : byte
(* Defaults:
let _backColor = defaultArg backColor new Color()
let _alphaThreshold = defaultArg alphaThreshold 128
*)
-> IWritableBitmapData
- bitmap WriteableBitmap
- A WriteableBitmap 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 setting pixels with transparency when the pixel format of the source bitmap does not support transparency or alpha gradient.
See also the backColor and alphaThreshold parameters.
See the Remarks section of the WorkingColorSpace enumeration for more details. - backColor Color (Optional)
- When setting pixels of indexed bitmaps and bitmaps without alpha support, specifies the color of the background.
Color values with alpha, which are considered opaque will be blended with this color before setting the pixel in the result bitmap data.
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)
- When setting pixels of bitmaps with a palette that has a transparent color,
then specifies a threshold value for the Color.A property, under which the color is considered transparent. If 0,
then the pixels to be set will never be transparent. This parameter is optional.
Default value: 128.
IWritableBitmapDataAn
IWritableBitmapData instance, which provides fast write-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
WriteableBitmap. 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).