ImageEn, unit iemview

TImageEnMView.FillFromList

TImageEnMView.FillFromList


Declaration

procedure FillFromList(ssFiles: TStrings; const Directory: String = '';
                       LoadOnDemand : boolean = true;
                       DefaultTopText : TIEImageEnMViewDefaultText = iedtNone;
                       DefaultInfoText : TIEImageEnMViewDefaultText = iedtNone;
                       DefaultBottomText : TIEImageEnMViewDefaultText = iedtFilename;
                       GetFileInfo: Boolean = False);


Description

Fills the ImageEnMView with files from the specified Directory. For each file ImageFileName will be set with the full path and ImageBottomText with the filename.
You can cancel the insertion of files by setting MIO.Aborting := True;

Parameter Description Default
ssFiles A list of files to add  
Directory If Directory is '', then ssFiles must contain full paths. Otherwise, specify a folder name for Directory and only filenames for ssFiles ''
LoadOnDemand If True (Default), images are only loaded as they are displayed (i.e. not until they are scrolled into view). Set to false to load all images immediately True
DefaultTopText Specify the text that is applied to ImageTopText iedtNone
DefaultInfoText Specify the text that is applied to ImageInfoText iedtNone
DefaultBottomText Specify the text that is applied to ImageBottomText iedtFilename
GetFileInfo If true, the meta data fields, ImageFileSize, ImageCreateDate and ImageEditDate, will be filled (which may reduce performance) False

Note: Does NOT clear existing content. Use Clear first to replace existing content


Examples

MyFiles := TStringList.create();
MyFiles.Add( 'C:\Images\AnImage.jpg' );
MyFiles.Add( 'C:\Images\Image2.jpg' );
MyFiles.Add( 'C:\Images\3rdImage.png' );
ImageEnMView1.Clear();
ImageEnMView1.FillFromList( MyFiles );
MyFiles.Free;

// Alternatively, you can use:
MyFiles := TStringList.create();
MyFiles.Add( 'AnImage.jpg' );
MyFiles.Add( 'Image2.jpg' );
MyFiles.Add( '3rdImage.png' );
ImageEnMView1.Clear();
ImageEnMView1.FillFromList( MyFiles, 'C:\images' );
MyFiles.Free;

// Which is the same as
ImageEnMView1.Clear();
ImageEnMView1.AppendImage( 'C:\Images\AnImage.jpg' );
ImageEnMView1.AppendImage( 'C:\Images\Image2.jpg' );
ImageEnMView1.AppendImage( 'C:\Images\3rdImage.png' );

// Display an open dialog to allow multiple images to be added
OpenImageEnDialog1.Options := OpenImageEnDialog1.Options + [ ofAllowMultiSelect ];
if OpenImageEnDialog1.Execute() then
  ImageEnMView1.FillFromList( OpenImageEnDialog1.Files );


See Also

AppendImage
InsertImage
FillFromDirectory
FillFromZip
TIEMultiBitmap.FillFromList