TdcSystemImageList component
Properties |
The dcSystemImageList gives access to the system image list. That's the image list which all icons (32x32 or 16x16) for various file types that Explorer uses. All these icons represents the files within the Windows shell.
|
Just point the Images property of any component, which uses the ImageList's to display images, to the dcSystemImageList. The icons will be taken from the list of system images.
|
|
For example, if you have the ListView which contains the list of files, you can use the dcSystemImageList as source for file icons.
|
|
To retrieve small icons (16x16) - set the ImageSize property to is16x16. To retrieve large icons (32x32) - set the ImageSize property to is32x32.
|
You can use the dcSystemImageList together with the dcDiskScanner or dcMultiDiskScanner components. For example, you need to find some certain files and show them in the ListView + use the system image list as source for images that represents the icons for found files.
|
|
Then point the SmallImages property of the ListView to the dcSystemImageList component with ImageSize equal to is16x16 (and/or LargeImages property to the dcSystemImageList where the ImageSize = is32x32). Hook the OnFileFound event of the dc[Multi]DiskScanner component, and use SysImageIndex parameter to specify the image index for the list items.
|
|
procedure TForm1.dcDiskScanner1FileFound(Sender: TObject; FileName, FileType: String; FileSize: Extended; FileTime: TDateTime; FileAttributes: TdcScanAttributes; LargeIcon, SmallIcon: TIcon; SysImageIndex: Integer; TotalFiles: Integer; TotalSize: Extended);
|
var
|
ListItem: TListItem;
|
begin
|
ListItem := ListViews.Items.Add;
|
ListItem.Caption := FileName;
|
ListItem.ImageIndex := SysImageIndex;
|
end;
|
1. You can use/retrieve the icons of this list, but can not modify (add/delete) them.
|
2. You don't need to use the dcSystemImageList with dcFolderListView, because the dcFolderListView automatically uses the system images internally.
|
dcDiskScanner and dcMultiDiskScanner component.
|