ReadableBitmapDataExtensionsToBitmap(IReadableBitmapData, PixelFormat, IQuantizer, IDitherer) Method
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 10.0.0-rc.1
public static Bitmap ToBitmap(
this IReadableBitmapData source,
PixelFormat pixelFormat,
IQuantizer? quantizer = null,
IDitherer? ditherer = null
)
<ExtensionAttribute>
Public Shared Function ToBitmap (
source As IReadableBitmapData,
pixelFormat As PixelFormat,
Optional quantizer As IQuantizer = Nothing,
Optional ditherer As IDitherer = Nothing
) As Bitmap
public:
[ExtensionAttribute]
static Bitmap^ ToBitmap(
IReadableBitmapData^ source,
PixelFormat pixelFormat,
IQuantizer^ quantizer = nullptr,
IDitherer^ ditherer = nullptr
)
[<ExtensionAttribute>]
static member ToBitmap :
source : IReadableBitmapData *
pixelFormat : PixelFormat *
?quantizer : IQuantizer *
?ditherer : IDitherer
(* Defaults:
let _quantizer = defaultArg quantizer null
let _ditherer = defaultArg ditherer null
*)
-> Bitmap
- source IReadableBitmapData
- The source IReadableBitmapData instance to convert.
- pixelFormat PixelFormat
- The desired result pixel format.
- quantizer IQuantizer (Optional)
- An optional IQuantizer instance to determine the colors of the result.
If and pixelFormat is an indexed format, then a default palette and quantization logic will be used. This parameter is optional.
Default value: . - ditherer IDitherer (Optional)
- The ditherer to be used. Might be ignored if quantizer is not specified
and pixelFormat represents an at least 24 bits-per-pixel size. This parameter is optional.
Default value: .
BitmapA
Bitmap converted from the specified
source.In Visual Basic and C#, you can call this method as an instance method on any object of type
IReadableBitmapData. 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.
Use the
BeginToBitmap
or
ToBitmapAsync (in .NET Framework 4.0 and above)
methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.
To produce a Bitmap with the best matching pixel format to source,
use the ToBitmap(IReadableBitmapData) overload instead.