[MSEide-MSEgui-talk] display images

classic Classic list List threaded Threaded
41 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] display images

code dz
Hi Martin
i want to display all the images in a particular folder as a
thumbnails , what is the proper widgets for that ? .


thanks

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

test.png (13K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
On Friday 27 October 2017 10:28:07 code dz wrote:
> Hi Martin
> i want to display all the images in a particular folder as a
> thumbnails , what is the proper widgets for that ? .
>
If there are not too much items and the size is small a tlistview with an
accompanied timagelist.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
there are more than 80 images (png , jpg) with sizes (512x512 ,
1024x1024 , 256x256 , 128x128)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
On Friday 27 October 2017 11:00:27 code dz wrote:
> there are more than 80 images (png , jpg) with sizes (512x512 ,
> 1024x1024 , 256x256 , 128x128)
>
They will be stretched to the tumbnail size while loading so it probably is
OK. 80 48x48 thumbnails occupy sqrt(80)*48 = 430*430 pixels on the server.
I recommend to use GraphicsMagick (unit lib/common/image/msemagickstream)
instead of the FPC conversion functions. GraphicsMagick is much faster.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
thanks .
i'll test

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
In reply to this post by mse
i used this code to load images
the listview display sliced images , how to display stretched  image ?

procedure tmainfo.on_create(const sender: TObject);
const
        imgDir = 'imgs/';
var
        img_names : array[0..9] of string = ('1.png','2.png','3.jpg','4.png','5.png',
                        '6.png','7.png','8.png','9.png','10.png');
    bmp  : tmaskedbitmap;
    i    : longint;
    item : tlistitem;
begin

        for i:=0 to 9 do begin
          bmp := tmaskedbitmap.create(bmk_rgb);
          bmp.loadfromfile(imgDir+img_names[i]);
          timagelist1.addimage(bmp);
          bmp.free;
        end;
       
    // display
    timagelist1.beginupdate();
    for i:= 0 to timagelist1.count-1 do begin
      item:= tlistitem.create();
      item.imagenr:= i;
      tlistview1.itemlist.add(item);
    end;
    timagelist1.endupdate();
end;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

test.png (58K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
On Friday 27 October 2017 13:23:17 code dz wrote:
> i used this code to load images
> the listview display sliced images , how to display stretched  image ?
>
> for i:=0 to 9 do begin
>  bmp := tmaskedbitmap.create(bmk_rgb);
>  bmp.loadfromfile(imgDir+img_names[i]);
>  timagelist1.addimage(bmp,[al_stretchx,al_stretchy]); <<<<<----
>  bmp.free;
> end;
(not tested).
IIRC GraphicsMagick can stretch while loading.
"
function readgmgraphic(const source: tstream; const dest: tbitmap;
             const aindex: integer = -1; const awidth: integer = 0;
             const aheight: integer = 0; const arotation: real = 0;
             const abackgroundcolor: colorty = cl_transparent;
             const apixelpermm: real = 0;
             const aoptions: gmoptionsty = [];
             const afilter: filtertypes = undefinedfilter;
             const ablur: real = defaultblur): string;
              //returns label
"

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

fredvs
Hello.

Can MSE display animated png ?

https://en.wikipedia.org/wiki/APNG

This because mp3 picture-tag can only deal with png or jpg images.
(And because no mp3 player exists that can render animated png pictures).

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
In reply to this post by mse
thanks , i'll continue using fpimage , it's a bit slow yes , but i
don't like dependency ;)

i once tried to translate stb_image.h
(https://github.com/nothings/stb/blob/master/stb_image.h) to pascal
but i found that the author used c++ sse intrinsic , which is tricky
to translate to pascal.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
In reply to this post by fredvs
On Friday 27 October 2017 14:02:25 fredvs wrote:
> Hello.
>
> Can MSE display animated png ?
>
No. Maybe the frames can be extracted with GraphicksMagick and the image tick
made with tanimtimer.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
In reply to this post by mse
On 10/27/2017 01:39 PM, Martin Schreiber wrote:

> On Friday 27 October 2017 13:23:17 code dz wrote:
>> i used this code to load images
>> the listview display sliced images , how to display stretched  image ?
>>
>> for i:=0 to 9 do begin
>>  bmp := tmaskedbitmap.create(bmk_rgb);
>>  bmp.loadfromfile(imgDir+img_names[i]);
>>  timagelist1.addimage(bmp,[al_stretchx,al_stretchy]); <<<<<----
>>  bmp.free;
>> end;
> (not tested).

Or better [al_fit].

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
the images are not x centered inside the listview boxes .
seems  tlistview.itemlist.magealignment[al_xcentered] does not work ,
or i missed something  ;)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

test.png (36K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
On Saturday 28 October 2017 22:58:53 code dz wrote:
> the images are not x centered inside the listview boxes .
> seems  tlistview.itemlist.magealignment[al_xcentered] does not work ,
> or i missed something  ;)

Works for me if captionpos = cp_center, see attachment.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

imagepos.png (31K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
In reply to this post by mse
On Saturday 28 October 2017 17:10:48 Martin Schreiber wrote:

> On 10/27/2017 01:39 PM, Martin Schreiber wrote:
> > On Friday 27 October 2017 13:23:17 code dz wrote:
> >> i used this code to load images
> >> the listview display sliced images , how to display stretched  image ?
> >>
> >> for i:=0 to 9 do begin
> >>  bmp := tmaskedbitmap.create(bmk_rgb);
> >>  bmp.loadfromfile(imgDir+img_names[i]);
> >>  timagelist1.addimage(bmp,[al_stretchx,al_stretchy]); <<<<<----
> >>  bmp.free;
> >> end;
> >
> > (not tested).
>
> Or better [al_fit].
>
Git master eb01767dc998793988683b633ff3b62a9464a67e also has "al_thumbnail"
which does not enlarge images. ->
"
 imagelist1.addimage(bmp,[al_thumbnail,al_xcentered,al_ycentered]);
"
Martin



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
In reply to this post by mse
>
> Works for me if captionpos = cp_center, see attachment.
>

that what was missing ;) thanks

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
In reply to this post by mse
btw , tha quality of images inside listview is very low , dose msegui
offer something for that ?
even though i don't think image filtering is belong to gui library ;) .

thanks

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
On Sunday 29 October 2017 11:05:50 code dz wrote:
> btw , tha quality of images inside listview is very low , dose msegui
> offer something for that ?

"al_intpol" requests to interpolate pixels.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

code dz
i enable it , but there is no difference

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

with_al_intpol.png (57K) Download Attachment
without_al_intpol.png (55K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

fredvs
In reply to this post by mse
> GraphicksMagick

Huh, I would prefer not use a external library...

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] display images

mse
Administrator
In reply to this post by code dz
On Sunday 29 October 2017 12:06:43 code dz wrote:
> i enable it , but there is no difference

Which operating system? I assume that for downscaling a sum per pixel
algorithm will be used anyway.
For upscaling the difference is visible, see attachment with 16x16 -> 24x24,
the second item is with al_intpol.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

al_intpol.png (5K) Download Attachment
123