añadir pequeño icono a la vista virtual
Estoy intentando agregar un pequeño icono a VirtualTreeview en delphi2010. Tengo ImageList adjunta a VirtualTreeview usando las imágenes de la propiedad.
procedure TMainFrm.VSTGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
var Ghosted: Boolean; var ImageIndex: Integer);
var
FileInfo: PFileInfoRec;
begin
if Kind in [ikNormal , ikSelected] then
begin
if Column = 0 then
ImageIndex :=ImageList1.AddIcon(FileInfo.FileIco);
end;
end;
pero después de agregar los iconos se ven muy oscuros:
FileInfo Strucutre (registro con métodos) se rellena cuando cargo los archivos, así que lo que necesito es simplemente agregar el fileico de fileinfo a imagelist y mostrarlo en vista de árbol
type
PFileInfoRec= ^TFileInfoRec;
TFileInfoRec = record
strict private
vFullPath: string;
.
.
.
vFileIco : TIcon;
public
constructor Create(const FilePath: string);
property FullPath: string read vFullPath;
.
.
.
property FileIco : TIcon read vFileIco;
end;
el constructor
constructor TFileInfoRec.Create(const FilePath: string);
var
FileInfo: SHFILEINFO;
begin
vFullPath := FilePath;
.
.
.
vFileIco := TIcon.Create;
vFileIco.Handle := FileInfo.hIcon;
// vFileIco.Free;
end;
Entonces, ¿dónde está el problema? ! Gracias