AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

BUG in VT with Timagelist ?

Ein Thema von perry4916 · begonnen am 5. Feb 2010 · letzter Beitrag vom 5. Feb 2010
Antwort Antwort
perry4916

Registriert seit: 17. Jan 2010
4 Beiträge
 
#1

BUG in VT with Timagelist ?

  Alt 5. Feb 2010, 04:01
I'm thinking this is a bug

When i have a Timagelist with 20 icons in it and connect the Imagelist
to VT, then once the list is shown, The icon for Node 3-10 is the same.
1-2 and 11-20 are all different ones.

the weird thing is when, I put a TJImageviewer on my form
and connect the VT.images list to the Imageviewer, then everything
shows fine. but VT seems to have a problem

this is what i am using for the event

Delphi-Quellcode:
procedure Tdsmainform.treeGetImageIndex(Sender: TBaseVirtualTree;
  Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
  var Ghosted: Boolean; var ImageIndex: Integer);
var
Data: PTreeData;
begin
Data := Sender.GetNodeData(Node);
if Column = 0 then imageindex:=data.imagenumber-1;
end;
unless i am doing something wrong ?
The column=0 is for putting the icon in the 1st column in my tree.
  Mit Zitat antworten Zitat
Benutzerbild von Gollum
Gollum

Registriert seit: 14. Jan 2003
Ort: Boxberg
456 Beiträge
 
Delphi 10.1 Berlin Professional
 
#2

Re: BUG in VT with Timagelist ?

  Alt 5. Feb 2010, 08:28
Hallo,

I always had this problem, but I found the solution in the Demo-Program of the VT.

Use the function below in the OnCreate-Event of your Form:
Delphi-Quellcode:
uses
  Controls, CommCtrl;

// To show smooth images we have to convert the image list from 16 colors to high color.
procedure ConvertToHighColor(ImageList: TImageList);
var IL:TImageList;
begin
  // Have to create a temporary copy of the given list, because the list is cleared on handle creation.
  IL:=TImageList.Create(nil);
  try
    IL.Assign(ImageList);
    with ImageList do
      Handle:=ImageList_Create(Width, Height, ILC_COLOR16 or ILC_MASK, Count, AllocBy);
    ImageList.Assign(IL);
  finally
    IL.Free();
  end; // try
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:36 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz