View thumbnails / frames in Windows

What would be the easiest way to sketch, where do you have a panel with a vertical scrollbar and an image matrix describing their associated image? I would also like if the parent frame was resized horizontally, the matrix would be reduced to as many columns as needed to display thumbnails without a horizontal scrollbar. I would like to be able to drag and drop these thumbnails. The toolkit on which it is written does not really matter much. If you know a good way to do this with MFC, that's cool, the Delphi / C ++ developer is also very cool. Just some kind of native application infrastructure.

Wow, this is very similar to what I ask for help at home. I swear, this is for some laser projector control programs.

+1
source share
3 answers

Take a look at the TMS AdvSmoothImageListBox :

alt text

AFAIK, registered Delphi customers can download TMS Smooth components for free without the Embarcadero website. If you are not a registered Delphi user, you can buy the collection from the TMS website.

+3
source

Here is a code snippet that I use to display a set of numImages variables of the number of webcams.

 const MaxImages = 24; type TForm1 = class(TForm) ... images: array[1..MaxImages] of TWebcamImage; numImages: integer; .... end; 

TWebCamImage is a descendant of TImage with some additional attributes, such as the source url of the webcam, file name for the saved image, and a double-click handler to open the image in an additional panel.

Here is the code used to place the images on the panel.

 procedure TForm1.ArrangeImages; var i, numh, numv : integer; const margin=2; begin case numImages of 1: begin numh:=1; numv:=1; end; 2: begin numh:=2; numv:=1; end; 3: begin numh:=3; numv:=1; end; 4: begin numh:=2; numv:=2; end; 5,6: begin numh:=3; numv:=2; end; 7,8: begin numh:=4; numv:=2; end; 9: begin numh:=3; numv:=3; end; 10: begin numh:=5; numv:=2; end; 11,12: begin numh:=4; numv:=3; end; 13,14,15: begin numh:=5; numv:=3; end; 16: begin numh:=4; numv:=4; end; 17,18,19,20: begin numh:=5; numv:=4; end; else begin numh:=6; numv:=4; end; end; for i:=1 to numImages do begin images[i].Width := (panel2.Width div numh) - margin * 2; images[i].Height := (panel2.Height div numv) - margin * 2; images[i].Top := (((i-1) div numh) * (panel2.Height div numv)) + margin; images[i].Left := (((i-1) mod numh) * (panel2.Width div numh)) + margin; end; end; 

this method is called when the form connected to the oncreate event and the onresize event is onresize .

 procedure TForm1.FormCreate(Sender: TObject); begin ... numImages:=0; for i:=1 to maxImages do begin imageURL:=ini.ReadString('images','imageURL'+intToStr(i),imageURLDefault); if imageURL<>'' then begin inc(numimages); images[numImages]:=TWebCamImage.create(self,panel2,imageURL); end; .... end; .... ArrangeImages; .... end; procedure TForm1.FormResize(Sender: TObject); begin ArrangeImages; end; 
0
source

I'm not quite sure that I understand you correctly, but I would start with a frame containing the image and its description. Then I used TFlowPanel to store frame instances. I think you don’t have to work hard to implement drag and drop. Never tried, however.

If there are a lot of images, you should go for ownerdraw and doublebuffered solutions, I think.

In the end, you just have to pick up the laser projection component and connect it to the laser projector control unit ...

0
source

All Articles