Recent

Author Topic: ThumbControl : how to load an image in the thumbviewer [SOLVED]  (Read 4538 times)

the_magik_mushroom

  • New Member
  • *
  • Posts: 11
Hello,

with the component ThumbControl,

when I click on a thumbnail, I want to load another image (test.jpg) INSTEAD of the image I've clicked on.
For example if I click on the 3rd image of the 5th row, I want test.jpg to appear in that exact thumb.

I can get the exact thumb with:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.ThumbControl1SelectItem(Sender: TObject; Item: TThreadedImage);
  2. begin
  3.    Label1.Caption := ExtractFileName(ThumbControl1.ImageLoaderManager.ActiveItem.URL);
  4.  
  5. if Item <> nil then
  6.   begin
  7.  ???
  8.   end;
  9. end;        
  10.  
   
But I can't figure out the code...

what I would like to create is, with mouse enter and mouse leave, a cool animation effect and load a different 2nd thumbs of all my images :)
many thanks         
« Last Edit: April 20, 2024, 11:42:40 pm by the_magik_mushroom »

the_magik_mushroom

  • New Member
  • *
  • Posts: 11
Re: ThumbControl : how to load an image in the thumbviewer
« Reply #1 on: April 14, 2024, 05:51:09 am »
I can really get the name of the image and the position, but I can't reload that specific image with another one...

Code: Pascal  [Select][+][-]
  1. procedure TForm1.ThumbControl1MouseMove(Sender: TObject; Shift: TShiftState; X,
  2.   Y: Integer);
  3. var itm:TThreadedImage;
  4. begin
  5.  itm:=ThumbControl1.ItemFromPoint(Point(x,y));
  6.  
  7. if assigned(itm) then begin Label1.Caption:=itm.URL; Screen.Cursor := crHandPoint; end else
  8.  begin Label1.Caption:=''; Screen.Cursor := crDefault; end;
  9. end;    
  10.  

wp

  • Hero Member
  • *****
  • Posts: 12464
Re: ThumbControl : how to load an image in the thumbviewer
« Reply #2 on: April 14, 2024, 11:50:03 am »
Which ThumbControl are you talking about? Lazarus does not contain such a control by default, but there are several of them out there in the internet.

jamie

  • Hero Member
  • *****
  • Posts: 6735
Re: ThumbControl : how to load an image in the thumbviewer
« Reply #3 on: April 14, 2024, 03:26:10 pm »
JvThumbView

I think.
The only true wisdom is knowing you know nothing

the_magik_mushroom

  • New Member
  • *
  • Posts: 11
Re: ThumbControl : how to load an image in the thumbviewer
« Reply #4 on: April 15, 2024, 02:17:10 am »
I'm sorry, this one :  https://github.com/theo222/lazarus-thumbviewer
                              https://www.lazarusforum.de/viewtopic.php?p=38892

many thanks  :-*

wp

  • Hero Member
  • *****
  • Posts: 12464
Re: ThumbControl : how to load an image in the thumbviewer
« Reply #5 on: April 15, 2024, 10:52:48 am »
If I understand correctly, you want to have two images per thumbnail, the first one displayed normally, and the second one displayed when the mouse is over it. I do not think that this is possible with theo's (or any other) thumb viewer. But maybe you should post this question also in the German forum where theo can be found more frequently.

the_magik_mushroom

  • New Member
  • *
  • Posts: 11
Re: ThumbControl : how to load an image in the thumbviewer
« Reply #6 on: April 16, 2024, 01:48:57 am »
yes, I don't think it's possible directly like this, this is why I simply want to load another image instead of one thumb. I'll try the German forums

 

TinyPortal © 2005-2018