ImageEn, unit imageenview

TImageEnView.LayersCreateFromFile

TImageEnView.LayersCreateFromFile


Declaration

function LayersCreateFromFile(Filename : string = ''; idx: Integer = -1) : Integer;


Description

Loads an image from a file and adds it as a new image layer.
If Filename is '' then an open dialog is displayed (using ExecuteOpenDialog) to allow the user to browse for an image to load for the layer.
idx specifies the insertion index for the layer, or -1 to append.
Returns the index of the new layer, or -1 in case of error.


Examples

// Prompt the user to select an image to load as a layer
ImageEnView1.LayersCreateFromFile();

// Load an image as a new layer
ImageEnView1.LayersCreateFromFile( 'C:\MyImage.jpg' );

// Which is the same as...
ImageEnView1.LayersAdd( 'C:\MyImage.jpg' );