ImageEn, unit iexSevenZip

SevenZip PlugIn


SevenZip is an open source library that ImageEn uses to read archive files.
The following archive formats are supported: Zip, ZipX, EPub, 7z, BZip2, Cab, Rar, Tar, ISO, CHM and LZH.

When the SevenZip plug-in is installed:
◼TImageEnView can load images from archive files and navigate the content of archive files (e.g. using onscreen Buttons)
◼TImageEnMView can load and display the content of archive files
◼TImageEnFolderMView can browse the content of archive files
◼TIEFolderTree can display the folder tree within an archive file

The following features are supported:
◼256bit AES and other encrypted zip files (with automatic password prompt)
◼Zip folders (or optional flat file display)
◼Extraction of all or individual zip files
◼Dynamic loading of thumbnails


Notes
◼The SevenZip plug-in requires you to ship ie7zip32.dll (for 32bit applications) or ie7zip64.dll (for 64bit applications). These files are included in the \DLL\Zip\ folder of the ImageEn installation
◼Distributions must include the copyright notices that are included in the \DLL\Zip\ folder
◼The plug-in must be registered once by your application
◼Archive files must have a supported extension: *.zip, *.zipx, *.epub, *.7z, *.bzip2, *.bz2, *.gzip, *.cab, *.rar, *.tar, *.iso, *.chm, *.lzh

Demos

Demo  Demos\Other\ZipBrowser\ZipBrowser.dpr
Demo  Demos\Multi\FolderMView\FolderMView.dpr

Examples

// Register the SevenZip Plug-In
IEGlobalSettings().RegisterPlugIns([ iepiSevenZip ]);

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

// Extract all files from a zip file to D:\Out\ (Recreating the internal zip folder structure)
ImageEnView1.IO.ExtractFromFileZIP( 'C:\Test.zip', -1, 'D:\Out\', True );

// Display all files within a zip (ignoring the internal folder structure)
ImageEnMView1.FillFromZIP( 'C:\Files\Images.zip' );

// Display files within the root folder of the zip
ImageEnMView1.FillFromZIP( 'C:\Files\Images.zip', '\' );

// Display files within the zip folder \Holidays\Italy\
ImageEnMView1.FillFromZIP( 'C:\Files\Images.zip', '\Holidays\Italy\' );

// Output all images in a ZIP file to PNG
filename := 'C:\doc.ZIP';
outputFolder := 'D:\';
bmp := TIEBitmap.Create();
bmp.ParamsEnabled := True;
idx := 0;
Repeat
  bmp.Params.ImageIndex := idx;
  if bmp.LoadFromFile( filename ) then
    bmp.SaveToFile( IncludeTrailingBackslash( outputFolder ) + Format( '%s_%d.png', [ ExtractFilename( filename ), idx+1 ] ));
  Inc( idx );
Until idx > bmp.Params.ImageCount - 1;
bmp.Free();

See Also

◼LoadFromFileZIP
◼ExtractFromFileZIP
◼LoadFromFileZIP
◼ExtractFromFileZIP
◼#ZIP Tags
◼ImageEn DLLs