ImageEn, unit imageenio

TImageEnIO.LoadFromFileZIP

TImageEnIO.LoadFromFileZIP


Declaration

function LoadFromFileZIP(const FileName: string; FileIndex: Integer = -1; const Password: string = ''): Boolean;


Description

Loads an image from an archive file into the attached TImageEnView or TIEBitmap using a plug-in.
The following archive formats are supported: Zip, ZipX, EPub, 7z, BZip2, Cab, Rar, Tar, ISO, CHM and LZH.
If FileIndex = -1, then ImageIndex will be used to specify which page of the ZIP file to load.
If the file is encrypted you can specify the password (otherwise a password prompt will be displayed if AutoPromptForPassword is enabled).
Result will be false if the file is not a supported format or the 7z plug-in is not found (Aborting will be true). Loading errors due to a file not being available will raise an exception.



Note:
Archive extraction requires the 7z plug-in
The archive file must have a supported extension: *.zip, *.zipx, *.epub, *.7z, *.bzip2, *.bz2, *.gzip, *.cab, *.rar, *.tar, *.iso, *.chm, *.lzh
FileName can include the full path to a file within the zip (instead of specifying a file index), e.g. C:\Folder\MyZip.zip\Path\image.jpeg
Read more about ImageEn ZIP Support


Example

// Load the first file in a zip and show buttons to allow navigation
ImageEnView1.ShowButtons := [ iebtPrevious, iebtNext ];
ImageEnView1.IO.LoadFromFileZIP( 'C:\Test.zip', 0 );

// Load a specific file within a zip
ImageEnView1.IO.LoadFromFileZIP( 'C:\Folder\MyZip.zip\Path\image.jpeg' );