Click or drag to resize
Accord.NET (logo)

UnmanagedImageFromByteArray Method

Create unmanaged image from the specified byte array.

Namespace:  Accord.Imaging
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.7.0
Syntax
public static UnmanagedImage FromByteArray(
	byte[] bytes,
	int width,
	int height,
	PixelFormat pixelFormat
)
Request Example View Source

Parameters

bytes
Type: SystemByte
Source byte array containing the image's pixels.
width
Type: SystemInt32
The width of the image.
height
Type: SystemInt32
The height of the image.
pixelFormat
Type: System.Drawing.ImagingPixelFormat
The PixelFormat of the pixels.

Return Value

Type: UnmanagedImage
Returns new unmanaged image, which is a copy of source managed image.
Exceptions
ExceptionCondition
UnsupportedImageFormatExceptionUnsupported pixel format of source image.
Remarks

The method creates an exact copy of specified managed image, but allocated in unmanaged memory.

See Also