AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi VirtualTree problems. Soft-gems = no support at all.
Thema durchsuchen
Ansicht
Themen-Optionen

VirtualTree problems. Soft-gems = no support at all.

Ein Thema von perry4916 · begonnen am 17. Jan 2010 · letzter Beitrag vom 2. Feb 2010
Antwort Antwort
perry4916

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

VirtualTree problems. Soft-gems = no support at all.

  Alt 17. Jan 2010, 04:02
Hello,
I found this board that someone referred to on the VST forum, since that one is pretty much dead.

I'm having a problem with drawing Images in my tree.
when I draw the items, it's all fine, but

the OnafterPaint event is always triggered, so it keeps refreshing the images.
(I cannot use an Timagelist since it's giving me problems when i am loading 4700 icons in it)

So the question is:
Is there an option to disable all the onpaint / onafterpaint / ongettext when the mouse moves?

things keeps refreshing with the wrong info on certain lines, since
it's not getting the correct info, if you are moving the mouse too fast
it's reading the wrong row.

thank you very much for your help


Perry
  Mit Zitat antworten Zitat
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#2

Re: VirtualTree problems. Soft-gems = no support at all.

  Alt 17. Jan 2010, 07:47
Hi Perry,

Just an idea: Have you tried using several imagelists? You can then assign them in OnGetImageIndexEx.
Thomas
  Mit Zitat antworten Zitat
Benutzerbild von chaosben
chaosben

Registriert seit: 27. Apr 2005
Ort: Görlitz
1.358 Beiträge
 
Delphi XE2 Professional
 
#3

Re: VirtualTree problems. Soft-gems = no support at all.

  Alt 17. Jan 2010, 11:31
VST isn't dead (but the forum is ). The development ist still going on here.
Just a few days ago, they accepted a patch from us.
So, if there is a problem with the code of the VST, try posting an issue (with a demo showing your problem) there and i'm sure you'll get help.
Benjamin Schwarze
If I have seen further it is by standing on the shoulders of Giants. (Isaac Newton)
  Mit Zitat antworten Zitat
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#4

Re: VirtualTree problems. Soft-gems = no support at all.

  Alt 17. Jan 2010, 11:52
Zitat von chaosben:
VST isn't dead.
Not VST but the VST forum

Zitat:
VST forum, since that one is pretty much dead.
Thomas
  Mit Zitat antworten Zitat
perry4916

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

Re: VirtualTree problems. Soft-gems = no support at all.

  Alt 17. Jan 2010, 18:19
Hi,

I posted several months ago on the Forum there. (perry4916)
and no response. so yes, I mean the Forum seems to be dead. Don't know about the program itself.


To Benjamin

"
Just an idea: Have you tried using several imagelists? You can then assign them in OnGetImageIndexEx. "


I guess I don't know how to use the "ongetimageindexex" ?

problem i was having at that time is
that i have 4700 icons.
when i am loading them into a Timagelist, it takes a looooong time, and i will get "out of resources" error.

So, I created a cache file (basicly 1 BMP) that had all the images next to eachother.
the filesize became 10 Mb and the image size was something like 4302249 x 23943
I was able to read that 1 picture into a timagelist and it automaticly splits the images for me.
but then also, i was getting randomly weird errors, "out of memory" "out of resource" etc

so I gave up.

So i am trying to find the best solution for it.


So now I have this on a event
and works great. but when you move the mouse, it's showing other icons on top of the 1 row i selected.
cause it's getting triggered everytime i move the mouse.
and if your going to fast it's not getting the proper X,Y information

Delphi-Quellcode:
procedure Tdsmainform.perrytreeAfterItemPaint(Sender: TBaseVirtualTree;
  TargetCanvas: TCanvas; Node: PVirtualNode; ItemRect: TRect);
 
  procedure DrawIcon;
  var
   w, X, Y, i: Integer;
    BlobStream: TStream;
   Datap: ptreedata;
  begin
    try
    statusbar.caption:=inttostr(y);
    Datap := Sender.GetNodeData(Node);

    imagequery.SQL.Clear;
    imagequery.SQL.Text:= 'SELECT * FROM pic where romnumber = "'+datap.romscenenumber+'"';
    imagequery.Open ;
    imagequery.first;
    if imagequery.RecordCount=0 then exit;
    if imagequery.FieldByName ('picc').IsNull then exit;
    tempBmp.Width := 32;
    tempBmp.Height := 32;
    //tempbmp.PixelFormat := pf24Bit;
    BlobStream := imagequery.CreateBlobStream(imagequery.FieldByName('picc'),bmRead);
    try
       apng.LoadFromStream(BlobStream);
    finally
       BlobStream.Free;
    end;
    tempBmp.Canvas.Draw(0, 0, aPng);
    resizebmp(tempbmp,newiconbmp,24,24);
    X := ItemRect.Left + TVirtualStringTree(Sender).Margin;
    Y := ItemRect.Top + 2;
    if perrytree.Header.Columns.Items[0].CaptionText='Iconthen x:=x+ perrytree.Header.Columns.Items[0].Left;

   TargetCanvas.Draw(X, Y, newiconbmp);
   except
      on E: EStreamError do ShowMessage(lang1108);
      on E: EInvalidGraphic do ShowMessage(lang1109);
    end;

  end;


begin
DrawIcon;
end;
  Mit Zitat antworten Zitat
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#6

Re: VirtualTree problems. Soft-gems = no support at all.

  Alt 23. Jan 2010, 08:54
Delphi-Quellcode:
procedure TForm1.VSTListeGetImageIndexEx(Sender: TBaseVirtualTree;
  Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
  var Ghosted: Boolean; var ImageIndex: Integer;
  var ImageList: TCustomImageList);
begin
  Case Something of ...
   // e.g. if Column = 1 then take Imagelist1
   // *or* if that node has a special flag, take Imagelist2 etc..
    1: ImageList := ImageList1;
    2: ImageList := ImageList2;
  end;
end;
Thomas
  Mit Zitat antworten Zitat
busybyte

Registriert seit: 15. Sep 2006
165 Beiträge
 
#7

Re: VirtualTree problems. Soft-gems = no support at all.

  Alt 23. Jan 2010, 09:51
maybe there is too much lag at your paintmethod, so the global(cause out of systemresources?) aPng/tempbmp/newiconbmp will be overwritten before finished the paint and the output becomes undefined.i solved this imagelist problem, using a pretty quick pointerlist to a recordtype of my images. it works up to 6000-7000 bitmaps. to get more, i sequencially load and free them, depending on the first and last visible items.always watch your variables not to be overwritten
too quick from the next call.
I love DiscCat
  Mit Zitat antworten Zitat
perry4916

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

Re: VirtualTree problems. Soft-gems = no support at all.

  Alt 2. Feb 2010, 21:04
Zitat von busybyte:
maybe there is too much lag at your paintmethod, so the global(cause out of systemresources?) aPng/tempbmp/newiconbmp will be overwritten before finished the paint and the output becomes undefined.i solved this imagelist problem, using a pretty quick pointerlist to a recordtype of my images. it works up to 6000-7000 bitmaps. to get more, i sequencially load and free them, depending on the first and last visible items.always watch your variables not to be overwritten
too quick from the next call.
I'm not real familiar with pointers etc.
do you load all your images first into a recordset?
but doesn't that take long?
how did you do it?

Thank you
  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 21:34 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