ImageEn, unit ievision

TIEVisionLibrary.createImage

TIEVisionLibrary.createImage


Declaration

function createImage(): TIEVisionImage; overload; safecall;
function createImage(width: int32_t; height: int32_t; channelFormat: TIEVisionChannelFormat; channels: int32_t): TIEVisionImage; overload; safecall;
function createImage(c: TIEVisionImage): TIEVisionImage; overload; safecall;
function createImage(filename: PAnsiChar): TIEVisionImage; overload; safecall;
function createImage(width: int32_t; height: int32_t; channelFormat: TIEVisionChannelFormat; channels: int32_t; rowlen: int32_t; data: pointer): TIEVisionImage; overload; safecall;


Description

First overload creates a new empty image object.
Second overload creates a new image object of the specified size and format.
Third overload creates a new image object from another TIEVisionImage object.
Fourth overload creates a new image from the specified file. Currently supported file formats are: TIFF, JPEG, BMP, PNG, PXM, J2K (JPEG2000) and RAS.
Fifth overload creates a new image from the specified buffer (shares the same content). The buffer will be not released on destroy.

Parameter Description
width Image width.
height Image height.
channelFormat Channel format.
channels Number of channels.
c Source image to copy.
rowlen Row length in bytes.
data Raw data buffer.
filename Filename to load.


Example

// create 1000x1000 RGB image
image := IEVisionLib.createImage(1000, 1000, ievUINT8, 3);

// load 'input.jpg'
image := IEVisionLib.createImage('input.jpeg');

// share ImageEnView1 bitmap
ImageEnView1.IEBitmap.Origin := ieboTOPLEFT;
image := IEVisionLib.createImage(ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height,
                                 ievUINT8, 3, ImageEnView1.IEBitmap.Rowlen,
                                 ImageEnView1.IEBitmap.ScanLine[0]);

// the same result of previous code
image := ImageEnView1.IEBitmap.GetIEVisionImage();