ImageEn, unit iemview

TImageEnMView.AppendImage

TImageEnMView.AppendImage


Declaration


function AppendImage: Integer;
function AppendImage(Bitmap: TIEBitmap): integer;
function AppendImage(Bitmap : TBitmap): integer;
function AppendImage(Width, Height: Integer; PixelFormat: TIEPixelFormat = ie24RGB): Integer;
function AppendImage(const FileName: String): integer;
function AppendImage(const FileName: String;
                     LoadOnDemand : boolean;
                     DefaultTopText : TIEImageEnMViewDefaultText = iedtNone;
                     DefaultInfoText : TIEImageEnMViewDefaultText = iedtNone;
                     DefaultBottomText : TIEImageEnMViewDefaultText = iedtFilename;
                     bSelectIt : Boolean = true): integer;
function AppendImage(Stream: TStream; FileFormat: TIOFileType = ioUnknown): integer;


Description


AppendImage appends a new image at last position in the list and returns the new image position.

Note: First overload of AppendImage doesn't create the bitmap. Others load image from a file or a stream.

The parameters for the final overload are as follows:
Parameter Description
Filename The full path to a file or folder available on the system, or an HTTP or FTP link to a remote file. You can load a particular frame from a multi-frame image or video by delimiting it with IEM_Path_Index_Delimiter
LoadOnDemand If True, the image will not be loaded from disk until it is displayed (i.e. when it is scrolled into view)
DefaultTopText Specify the text that is applied to ImageTopText
DefaultInfoText Specify the text that is applied to ImageInfoText
DefaultBottomText Specify the text that is applied to ImageBottomText (defaults to the filename)
bSelectIt The new image will be selected in the control



Examples


ImageEnView1.IO.LoadFromFile( 'C:\MyImage.tif' );
idx := ImageEnMView1.AppendImage;
ImageEnMView1.SetImage( idx, ImageEnView1.IEBitmap );

// Which is the same as...
ImageEnMView1.AppendImage( 'C:\MyImage.tif' );

// Load the fifth image of MyImage.tif
ImageEnMView1.AppendImage( 'C:\MyImage.tif' + IEM_Path_Index_Delimiter + 4 );

// Append 256 x 256 bitmap
ImageEnMView1.AppendImage( 256, 256, ie24RGB );

// Append a file from the web
ImageEnMView1.AppendImage( 'http://www.imageen.com/graphics/imageen.gif' );

// Show ten frames of a video file
for I := 0 to 9 do
  ImageEnMView1.AppendImage( 'D:\Temp\Cement.avi' + IEM_Path_Index_Delimiter + IntToStr( I * 10 ));

// Append an image from a stream (letting ImageEn automatically detect the format)
ImageEnMView1.AppendImage( MemStream, ioUnknown );

// Append all pages of a TIFF to the current content
iPageCount := EnumTIFFIm( sFileName );
for I := 0 to iPageCount - 1 do
  ImageEnMView1.AppendImage( sFileName + IEM_Path_Index_Delimiter + IntToStr( I ));

// Fill the grid with the content of a TFileListBox
procedure TForm1.FileListBox1Change(Sender: TObject);
var
  i: Integer;
begin
  ImageEnFolderMView1.Clear();
  for i := 0 to FileListBox1.Items.Count - 1 do
    ImageEnFolderMView1.AppendImage( IEAddBackSlash(FileListBox1.Directory) + FileListBox1.Items[i], true );
end;


See Also


- InsertImage
- InsertImageEx
- FillFromList
- FillFromDirectory