ImageEn, unit iemview




property ImageFileName[idx: Integer]: WideString;


Specifies the file from where TImageEnMView will load the image for index, idx (loading is delayed until it needs to be shown).

A full file path must be specified. Optionally an image index can be specified for multi-page files in the form: "FullFilePath::ImageIndex", e.g. 'C:\doc.pdf' + IEM_Path_Index_Delimiter + '5'

Note: Use ImageFileName only for specifying the path to an image that can be loaded (i.e. do not use it to assign a custom name to a frame). Otherwise the image content may be cleared unexpectedly by the MaintainInvisibleImages function


// Load image1.jpg as thumbnail 0 and image2.jpg as thumbnail 1
ImageEnView1.ImageFileName[0] := 'C:\image1.jpg';
ImageEnView1.ImageFileName[1] := 'C:\image2.jpg';

// Load frame 0 and 1 from input.mpeg
ImageEnView1.ImageFileName[0] := 'C:\input.mpeg::0';
ImageEnView1.ImageFileName[1] := 'C:\input.mpeg::1';

// This example inserts two images. The first is loaded from 'one.tif' and the second from 'two.tif'.
/ The images are loaded only when these are shown (otherwise they are freed).
ImageEnMView1.ImageFileName[0] := 'C:\one.tif';
ImageEnMView1.ImageFileName[1] := 'C:\two.tif';

// Copy all files in the control a new folder
if WindowsSelectDirectory( 'Specify Folder to Copy to:', newFolder ) = False then
for I := 0 to ImageEnMView1.ImageCount - 1 do
  oldFilename := ImageEnMView1.ImageFilename[I];
  WindowsCopy(Form1.Handle, oldFilename, newFolder, True, True, True);

See Also

- LoadFromFileOnDemand