ImageEn, unit imageenio

TImageEnIO.LoadThumbnailFromExplorer

TImageEnIO.LoadThumbnailFromExplorer


Declaration

function LoadThumbnailFromExplorer(const FileName : WideString; DesiredWidth : Integer = 120; DesiredHeight : Integer = 120): Boolean;


Description

Retrieve the thumbnail for the specified file from Windows Explorer. This should work for any format that displays a thumbnail in Windows Explorer, including images and videos.
Use DesiredWidth and DesiredHeight to specify the size of the thumbnail that you require. Windows can be inconsistent with sizes smaller than 98x98 pixels (image may be returned upside down), so it is not recommended to use sizes smaller than 98x98.

The Aborting property will be true if the load fails (e.g. if there is not a thumbnail for this file type).


Example

// Load a thumbnail for a video
if ImageEnView1.IO.LoadThumbnailFromExplorer('D:\MyVideo.wmv') = False then
  ShowMessage('Load Error!');