views:

172

answers:

2

Hi,

The TShellList component is based on TListView which (unfortunately) doesn't have in its ViewStyle property a 'vsThumbnail' (or similar).

How can I display thumbnails in TShellList in a similar manner in which Windows Explorer does?

A simple Delphi snippet would be appreciated.

TIA

A: 

If you just want larger icons than default you can just resize TImageList you use. The example below is for TListView, but you will get the idea

const 
  PreviewSize = 128;
type
  TForm1 = class
    PreviewList: TImageList;
    List: TListView;
...

  PreviewList.Width = PreviewSize;
  PreviewList.Height = PreviewSize;
  PreviewList.Add(MyBitmap, Nil);
  List.Add.ImageIndex:=0;
Maksee
Perhaps I don't understand your answer, but isn't nothing about any TImageList. Or perhaps do you suggest to use an internal ImageList to draw the icons?
General approach if you design TListView with icons is to put also TImageList on the form and link ListView wutg it with the corresponding property. But without changing the size of ImageList you'll get the standard 32x32 icons. To make it bigger change the size. I successfully used this for generating image previews
Maksee
A: 

I have not used the TShellList component. However, if you are willing to look at a different component try VirtualShellTools from Mustang Peak. There can be a little learning curve with the component but I have found it to work very well for my needs. I use the TVirtualExplorerEasyListview and point it to a directory and it does all the work to create the thumbnails for images in that directory.

Mark Elder