ImageEn, unit iexShellThumbnails

WindowsGetExplorerThumbnail


Declaration

function WindowsGetExplorerThumbnail(const Filename: WideString; Bitmap: TBitmap; iWidth: Integer = 120; iHeight: Integer = 120; AlphaMethod: Boolean = True): Boolean; overload;
function WindowsGetExplorerThumbnail(const Filename: WideString; IEBitmap: TIEBitmap; iWidth: Integer = 120; iHeight: Integer = 120; AlphaMethod: Boolean = True): Boolean; overload;


Description

Returns the thumbnail from Windows Explorer for the specified file, which can be an image or a video file.
If AlphaMethod is true, a 32bit assignment is used. If False, a legacy assignment is used. Generally this should be true.
Result is false if no thumbnail is available for the file.

Note: If a non-standard size is used (i.e. NOT 16x16, 32x32, 48x48 or 96x96), Windows tends to return a bottom-up bitmap. This is automatically corrected with the TIEBitmap overload. For safety, it best to avoid sizes smaller than 98x98. Images larger than this should be consistently returned inverted by the TBitmap overload, and correctly orientated by the TIEBitmap overload.


Example

// Return a thumbnail for a video
WindowsGetFileIcon( 'C:\MyVideo.mpeg', ImageEnView1.IEBitmap, 256, 256 );
ImageEnView1.Update();


See Also

WindowsGetFileIcon
WindowsGetStockIcon