ReadableBitmapDataExtensionsToBitmap(IReadableBitmapData) Method
Converts the specified
source to a
Bitmap.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 8.1.0
public static Bitmap ToBitmap(
this IReadableBitmapData source
)
<ExtensionAttribute>
Public Shared Function ToBitmap (
source As IReadableBitmapData
) As Bitmap
public:
[ExtensionAttribute]
static Bitmap^ ToBitmap(
IReadableBitmapData^ source
)
[<ExtensionAttribute>]
static member ToBitmap :
source : IReadableBitmapData -> Bitmap
- source IReadableBitmapData
- The source IReadableBitmapData instance to convert.
BitmapA
Bitmap instance that has the same content as 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.
The result Bitmap will have the closest possible PixelFormat to source. If the source pixel format is not supported on the current platform,
then the result will have either Format24bppRgb or Format32bppArgb format, depending whether source has transparency.
On Windows every format is supported with more or less limitations. For details and further information about the possible usable
PixelFormats on different platforms
see the
Remarks section of the
ConvertPixelFormat method.