Recent

Author Topic: request for imagesgrid component  (Read 1609 times)

alaa123456789

  • Full Member
  • ***
  • Posts: 148
request for imagesgrid component
« on: January 23, 2021, 07:55:53 pm »
hi all ,
i was looking for free images grid component in Lazarus to view images thumbnails from folder or internet , then when we press thumbnail it open the big image in image
but unfortunately not find , could anyone help with this.

thanks

wp

  • Hero Member
  • *****
  • Posts: 8099
Re: request for imagesgrid component
« Reply #1 on: January 23, 2021, 11:28:55 pm »
TJvImagesView or TJvThumbView, both in JVCL (https://wiki.freepascal.org/JVCL_Components, unfortunately no screenshot...) - install via OPM.

Or theo's thumbviewer: https://github.com/theo222/lazarus-thumbviewer
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

alaa123456789

  • Full Member
  • ***
  • Posts: 148
Re: request for imagesgrid component
« Reply #2 on: January 24, 2021, 04:58:40 pm »
thanks for reply, is there any example how to use them?

wp

  • Hero Member
  • *****
  • Posts: 8099
Re: request for imagesgrid component
« Reply #3 on: January 24, 2021, 05:32:26 pm »
The JVCL installation contains an examples folder with a demo for every component. (Assign the image folder name to the Directory property of the viewer components).

With theo's thumbviewer, you must call  ThumbControl.ImageLoaderManager.AddImage(filename) for every filename to be added.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

alaa123456789

  • Full Member
  • ***
  • Posts: 148
Re: request for imagesgrid component
« Reply #4 on: January 24, 2021, 07:42:49 pm »
thanks wp,
but jvcl example not respond with folder have many photos , is there any way to avoid that?

wp

  • Hero Member
  • *****
  • Posts: 8099
Re: request for imagesgrid component
« Reply #5 on: January 24, 2021, 08:00:41 pm »
The JVCL controls load the images in the main thread, so you must be patient... With many images, theos viewer is faster because is load the images in a separate thread

Alternatively, or additionally, you can try to load the preview image embedded in many jpg files. You can use the fpexif library for this purpose (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/fpexif/ -- download the snapshot and unzip it into your project folder; there's nothing to install here). The package contains examples; the Simple_demo shows - among others - how to extract the preview image.
« Last Edit: January 24, 2021, 09:58:11 pm by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

wp

  • Hero Member
  • *****
  • Posts: 8099
Re: request for imagesgrid component
« Reply #6 on: January 25, 2021, 12:13:58 am »
Maybe adding the entire fpExif is too much just to extract the thumbnail.

In the attached project you can find the code which locates the thumbnail inside the jpg structure and stores it into a separate TJpegImage. There is also code to rotate the thumbnail according to the information stored in the exif (smartphone images often are upside down...).

For those cases in which no thumbnails are embedded I used the standard jpg image but before reading i set the Scale parameter to jsEighths which also speeds up loading a jpeg since it reduces the image to 1/8.

The demo only loads these thumbnail images and displays them in a TImage component. The thumbnail viewers mentioned in the other posts are not used at this time.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

alaa123456789

  • Full Member
  • ***
  • Posts: 148
Re: request for imagesgrid component
« Reply #7 on: January 25, 2021, 01:01:46 pm »
Maybe adding the entire fpExif is too much just to extract the thumbnail.

In the attached project you can find the code which locates the thumbnail inside the jpg structure and stores it into a separate TJpegImage. There is also code to rotate the thumbnail according to the information stored in the exif (smartphone images often are upside down...).

For those cases in which no thumbnails are embedded I used the standard jpg image but before reading i set the Scale parameter to jsEighths which also speeds up loading a jpeg since it reduces the image to 1/8.

The demo only loads these thumbnail images and displays them in a TImage component. The thumbnail viewers mentioned in the other posts are not used at this time.
i tried your example , but i got this error as per attachment

thanks

wp

  • Hero Member
  • *****
  • Posts: 8099
Re: request for imagesgrid component
« Reply #8 on: January 25, 2021, 01:04:17 pm »
Ah, seems that this property is only in Laz trunk. Simply comment this line.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

wp

  • Hero Member
  • *****
  • Posts: 8099
Re: request for imagesgrid component
« Reply #9 on: January 25, 2021, 10:18:50 pm »
I am adding a new version of the embedded thumbnail demo. Now it uses a TvThumbImagesViewer to display the thumbnails.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

alaa123456789

  • Full Member
  • ***
  • Posts: 148
Re: request for imagesgrid component
« Reply #10 on: January 26, 2021, 12:34:28 pm »
I am adding a new version of the embedded thumbnail demo. Now it uses a TvThumbImagesViewer to display the thumbnails.
thank you so much wp, it works now no issue with folder has many photos

thanks a lot

 

TinyPortal © 2005-2018