| ImageEn, unit iexShellThumbnails |
|
WindowsGetExplorerThumbnail
WindowsGetExplorerThumbnail
Declaration
function WindowsGetExplorerThumbnail(const Filename: WideString; Bitmap: TBitmap; ThumbWidth: Integer = 120; ThumbHeight: Integer = 120; AlphaMethod: Boolean = True; ThumbFlags: Integer = -1; AutoFlip: Boolean = True): Boolean; overload;
function WindowsGetExplorerThumbnail(const Filename: WideString; IEBitmap: TIEBitmap; ThumbWidth: Integer = 120; ThumbHeight: Integer = 120; AlphaMethod: Boolean = True; ThumbFlags: Integer = -1; AutoFlip: 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.
ThumbFlags specifies additional options for thumbnail customization. See
IShellItemImageFactory GetImage Flags. If unspecified, SIIGBF_BIGGERSIZEOK will be used.
If AutoFlip is set to false and 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 if
AutoFlip is true. However, for safety, it best to avoid sizes smaller than 98x98 which may give inconistent results (The TIEBitmap overload always uses images larger than this).
Result is false if no thumbnail is available for the file.
Example
// Return a thumbnail for a video
WindowsGetFileIcon( 'C:\MyVideo.mpeg', ImageEnView1.IEBitmap, 256, 256 );
ImageEnView1.Update();
See Also
◼LoadThumbnailFromExplorer
◼WindowsGetFileIcon
◼WindowsGetStockIcon