Create a list of thumbnails
Create a list of thumbnails
Hi,
I'm trying to get a number of first-page thumbnails for a list of file paths. With the GdViewer.GetPageThumbnailAsBitmap() method I have the problem that I would have to load each file with the viewer. I also tried to use the ThumbnailEx class in the background to get the thumbnails, but I didn't find a way to get the thumbnails as bitmap out of the control.
Is there an alternative way to get a list of thumbnails?
Thanks for helping,
Kind regards
Dominik Braun
I'm trying to get a number of first-page thumbnails for a list of file paths. With the GdViewer.GetPageThumbnailAsBitmap() method I have the problem that I would have to load each file with the viewer. I also tried to use the ThumbnailEx class in the background to get the thumbnails, but I didn't find a way to get the thumbnails as bitmap out of the control.
Is there an alternative way to get a list of thumbnails?
Thanks for helping,
Kind regards
Dominik Braun
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: Create a list of thumbnails
Hi,
You can use the GdPictureImaging class. Load each image, then use the following:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... ation.html
Best Regards,
Sami
You can use the GdPictureImaging class. Load each image, then use the following:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... ation.html
Best Regards,
Sami
Re: Create a list of thumbnails
Hi,
at first, thanks for the quick reply. The Imaging class works so far. But recently I had a problem when there are many thumbnails to create.
The code is nearly the same as the code in the reference guides. Anyway I posted the code below, we use C#. The problem occurs after repeating the process round about 200 times. Then the line "var thumb..." returns 0. Any idea what can cause this or can you reproduce it by repeating?
Thanks for your help,
kind regards
Dominik
at first, thanks for the quick reply. The Imaging class works so far. But recently I had a problem when there are many thumbnails to create.
The code is nearly the same as the code in the reference guides. Anyway I posted the code below, we use C#. The problem occurs after repeating the process round about 200 times. Then the line "var thumb..." returns 0. Any idea what can cause this or can you reproduce it by repeating?
Thanks for your help,
kind regards
Dominik
Code: Select all
GdPicture.GdPictureImaging gdImaging = new GdPicture.GdPictureImaging();
var id = gdImaging.CreateGdPictureImageFromFile(filename);
var thumb = gdImaging.CreateThumbnailHQ(id, gdImaging.GetWidth(id), gdImaging.GetHeight(id));
var b = gdImaging.GetBitmapFromGdPictureImage(thumb);
if (b != null)
c.Bitmap = (Bitmap)b.Clone();
else
c.Bitmap = null;
gdImaging.ReleaseGdPictureImage(id);
gdImaging.ReleaseGdPictureImage(thumb);
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: Create a list of thumbnails
Hi,
I do not know, and I cannot tell this way, it could be a memory issue in your application.
In any case, could you please check GetStat function if the thumb ==0, and see what the error is.
Best,
Sami
I do not know, and I cannot tell this way, it could be a memory issue in your application.
In any case, could you please check GetStat function if the thumb ==0, and see what the error is.
Best,
Sami
Re: Create a list of thumbnails
Hi,
the status is OutOfMemory, because the bitmaps which should be saved are too large. It works when the size for the CreateThumbnailHQ method is reduced. We just have to adapt it depending on the number of thumbs to create.
Another question: I noticed that a GdPictureImaging object is not able to create thumbs from pdf files. It seems we have to get a pdf plugin for that. I wondered if this is intended or a bug, because the functionality is available with the GdViewer. Can you say something about this?
Thanks
kind regards
Dominik Braun
the status is OutOfMemory, because the bitmaps which should be saved are too large. It works when the size for the CreateThumbnailHQ method is reduced. We just have to adapt it depending on the number of thumbs to create.
Another question: I noticed that a GdPictureImaging object is not able to create thumbs from pdf files. It seems we have to get a pdf plugin for that. I wondered if this is intended or a bug, because the functionality is available with the GdViewer. Can you say something about this?
Thanks
kind regards
Dominik Braun
Who is online
Users browsing this forum: No registered users and 2 guests