ZTree.com  | ZEN  | About...  

 Index   Back

[Tip] New ZAAP: ZPreview   [Tip]

By: Martijn Coppoolse   Homepage   Voorburg, NL  
Date: Feb 03,2015 at 15:07

Hi all,

I've been having trouble getting rpVT to run again lately, and I needed to be able to preview other file formats (such as PDF) as well, especially now that Windows Explorer also supports all kinds of file format previews. So I wrote my own previewer ZAAP.

Usage

As with any ZAAP, it requires an instance of ZTreeWin to be started with the /ZB command-line option.
Just run ZPreview.exe, and it should automatically find ZTreeWin and the zbar.dat file.
I've disabled UAC on my development machines, so I'm not certain this will work everywhere. (If anyone reports problems with this, I'll add an alternative way to find the zbar.dat file).

The previewer attempts to display the currently highlighted file according to the following methods:
1. Load and display the file as a graphic image using the FreeImage library (not in Win64 version);
2. Use the registered Windows Preview Handler for that file type;
3. Use the loaded Totalcommander WLX Lister plugin (you need to load one first, using Ctrl+L);
4. Load and display the file as a graphic image using Delphi's internal Graphic routines.

The current toolbar buttons:
* Refresh: reads the zbar.dat interface, and refreshes the preview
* Autorefresh: continually reads the zbar.dat interface, and refreshes the preview on every change. This tends to make the preview a bit less responsive (it doesn't affect ZTreeWin)
* ZTreeWin: activates the ZTreeWin window
* Sentinel: shows a popup window containing the current information in the zbar.dat file
* Image Info: shows a popup window containing the metadata of the current image, as reported by FreeImage. Note that there appears to be a problem in the interface to FreeImage's metadata handling; it has a tendency to generate errors when this window is left open. Not available in Win64.

The current keyboard shortcuts from within ZTreeWin:
* Ctrl-Shift-F4: closes ZPreview
* Ctrl-Shift-R: refreshes the preview
* Ctrl-Shift-S: toggles the Sentinel toolbar button
* Ctrl-Shift-I: toggles the 'Image Info' toolbar button
* Ctrl-Shift-F: toggles full screen view
* Ctrl-Shift-M: minimizes/unminimizes the ZPreview window.

Known problems

* Currently, the preview window starts in a default position, so you'll probably have to move it out of the way -- it doesn't save its window positions for next time, either.
* Only a single WLX lister plugin can be loaded at a time. In time, I'd like to be able to make the entire display routine more modular, so that it's possible to prioritize between FreeImage, Delphi Graphics, all installed Windows preview handlers, and as many WLX lister as wanted.
* The only way to load a WLX plugin is using the Ctrl-L hotkey when the ZPreview window is active and has the focus. Once loaded, it's not possible to unload the WLX plugin, except by loading another one. Or restarting ZPreview.

Download

In time, I will probably add it to my ZAAP repository at http://fossil.2of4.net/zaap, but so far only the source code is available there.

For now, the 32-bit version can be downloaded from http://martijn.coppoolse.com/upload/ZPreview_v1.0.0.1_w32.zip (uses FreeImage.dll to display images).
The 64-bit version can be downloaded from http://martijn.coppoolse.com/upload/ZPreview_v1.0.0.1_w64.zip (uses Delphi's —slower— internal routines to preview images).

Future plans

* Fix the known problems listed above
* Animate animated GIFs
* Support for shortcut keys from ZTreeWin:
- zooming in/out of images, and scrolling
- scrolling through PDF preview (if possible)


--
Martijn

1,407 views      
Thread locked
 

Messages in this Thread

 
94,499 Postings in 11,924 Threads, 348 registered users, 11 users online (1 registered, 10 guests)
Index | Admin contact |   Forum Time: Oct 23, 2019 - 7:45 pm EDT  |  Hits:28,802,622  (6,370 Today )
RSS Feed