Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Faster way to generate thumbnails

More
IP: 192.168.0.70 12 years 2 months ago #5021 by rtoshiro
Hi,

We are creating thumbnails Bitmap using Page.RenderToBmp, but, to generate about 300 thumbs, it is taking a lot of time, even running in faster devices (+30 seconds)

Are there any way to improve it? We are using one thread to loop through m_doc.GetPageCount() and getting Page with m_doc.GetPage(int)
For each Page, we create the bitmap, erase it and fill it with RenderToBmp.
Even with no caching, no writing, just to create the object Bitmap and trowing it away.

We have tried to initiate more than one thread, but in that case, the second thread created blank bitmaps.

Thank you.
Best
T
More
IP: 192.168.0.70 12 years 2 months ago - 12 years 2 months ago #5022 by radaee
try RenderThumb first, if return false, then using RenderToBmp
codes like:
Code:
if( RenderThumnb() ) { } else { RenderToBmp(); } RenderThumnb may return false, if the PDF file has no thumbnail image for each page.
Last edit: 12 years 2 months ago by .
More
IP: 192.168.0.70 12 years 1 month ago #5044 by rtoshiro
But we are calling it in parallel with PDF reading, in another thread.
It returns false most of time and it is still taking too much time to render bitmap.

Thank you.
Best
T
More
IP: 192.168.0.71 12 years 6 days ago #5721 by honzamusil
Hi,
I have the same issue. I need to save bitmaps/thumbnails for whole pdf. approx. 60pages. But it takes around 30seconds to save one.
How do you generate bitmap for zoom, can I use the same method. Or can I access these bitmaps?

Thanks for help
More
IP: 192.168.0.71 12 years 6 days ago #5722 by radaee
save pages to sdcard?
it shall be slower than keep Bitmap objects, for this method need compress pixels data to png or jpeg file, and decompress when loading.
More
IP: 192.168.0.71 12 years 6 days ago #5724 by honzamusil
I want to keep them in cache directory. I didn't start to safe them yet because creating take too much time. So I need to find better (quicker) way how to create all thumbnails. For now I'd have to wait approx 30minutes to generate all thumbnails and display them in a view
Time to create page: 0.439 seconds
Powered by Kunena Forum