Allocate new image in unmanaged memory.

Namespace:  AForge.Imaging
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public static UnmanagedImage Create(
	int width,
	int height,
	PixelFormat pixelFormat
)

Parameters

width
Type: System..::.Int32
Image width.
height
Type: System..::.Int32
Image height.
pixelFormat
Type: System.Drawing.Imaging..::.PixelFormat
Image pixel format.

Return Value

Return image allocated in unmanaged memory.

Remarks

Allocate new image with specified attributes in unmanaged memory.

Note:The method supports only Format8bppIndexed, Format16bppGrayScale, Format24bppRgb, Format32bppRgb, Format32bppArgb, Format32bppPArgb, Format48bppRgb, Format64bppArgb and Format64bppPArgb pixel formats. In the case if Format8bppIndexed format is specified, pallete is not not created for the image (supposed that it is 8 bpp grayscale image).

Exceptions

ExceptionCondition
AForge.Imaging..::.UnsupportedImageFormatExceptionUnsupported pixel format was specified.
AForge.Imaging..::.InvalidImagePropertiesExceptionInvalid image size was specified.

See Also