Click or drag to resize
Accord.NET (logo)

UnmanagedImageCreate Method (Int32, Int32, PixelFormat)

Allocate new image in unmanaged memory.

Namespace:  Accord.Imaging
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.8.0
Syntax
public static UnmanagedImage Create(
	int width,
	int height,
	PixelFormat pixelFormat
)
Request Example View Source

Parameters

width
Type: SystemInt32
Image width.
height
Type: SystemInt32
Image height.
pixelFormat
Type: System.Drawing.ImagingPixelFormat
Image pixel format.

Return Value

Type: UnmanagedImage
Return image allocated in unmanaged memory.
Exceptions
ExceptionCondition
UnsupportedImageFormatExceptionUnsupported pixel format was specified.
InvalidImagePropertiesExceptionInvalid image size was specified.
Remarks

Allocate new image with specified attributes in unmanaged memory.

Note 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).

See Also