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
Adds a new image at last position in the list and returns the new image position.
Notes:
- First overload of AppendImage() does NOT create the bitmap. You can initialize an empty bitmap with AppendImage( 0,0,ie24RGB )
- With
TIEBitmap overload, the source bitmap may be modified
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;
// Append a JPEG that is Base64 encoded
ms := TMemoryStream.Create();
try
IEDecode64( SourceStream, ms);
ms.Position := 0;
ImageEnMView1.AppendImage( ms, ioJPEG );
finally
ms.Free();
end;
See Also
-
InsertImage-
InsertImageEx-
FillFromList-
FillFromDirectory