Registriert seit: 26. Jan 2011
344 Beiträge
Delphi 12 Athens
|
AW: ListView Icon Transparenz Problem
21. Okt 2018, 22:15
Ein FileListView geht so: (Abriss)
Code:
var ImageList: TImageList;
...
var sfi: TShFileInfo;
ImageList:=TImageList.Create(nil);
ImageList.Handle:=SHGetFileInfo(PChar(GetWinDir), 0, sfi, sizeof(TShFileInfo), SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
ImageList.ShareImages:=True;
ImageList.BkColor:=clNone;
ImageList.BlendColor:=clNone;
...
ListView1.SmallImages:=ImageList;
...
var sfi: TShFileInfo;
SHGetFileInfo(PChar(FileName), 0, sfi, sizeof(TSHFileInfo), SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
with ListView1.Items.Add do
begin
Caption:=ExtractFileName(FileName);
...
ImageIndex:=sfi.iIcon;
end;
...
ImageList.Free;
|
|
Zitat
|