Home | About us | Overview | Softwares - Downloads | Evaluate | Order | Support | old forums | Contact | F.A.Q. | Documentations | Search | Sitemap

Creating Thumbnail Bitmaps

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Creating Thumbnail Bitmaps

Postby dapedley on Tue Mar 11, 2008 4:22 pm

I am working with BDS C++ under Win XP and the display of (potentially) multi-page PDF files. I am trying to create a vertical, scrolling image containing thumbnails of each page, similar to that in Adobe. Three questions, if I may:

1. The following code (adapted from a previously posted example) successfully creates individual thumbnail bitmaps from a multi-page pdf. The problem is that it takes around 7 seconds to do so for a 16-page scanned pdf (on a reasonably fast Core 2 Duo PC). A 100-page pdf would presumably take around 40+ seconds. This is far from ideal, particularly as users may have slower processors.
The hold-up seems to be in the DisplayFrame(pgNo) method, which takes something over 1/3 second for each execution. Is this the most efficient methodology, please? (it seems rather convoluted). Can anything be done to speed up the process?

for (n = 1; n <= FNPages; n++)
{ MyGdViewer->DisplayFrame (n); //This statement takes approx 1/3 sec per execution
Img->SetNativeImage (MyGdViewer->GetNativeImage());
int wid=..., ht=...;
TBitmap *bm = new TBitmap; // the remainder looks convoluted but in fact only takes around 15ms per pass
long tnImgId = img->CreateThumbnail(Img->GetNativeImage(), wid, ht);
Img->SetNativeImage(tnImgId);
bm->Handle = (HBITMAP) img->GetHBitmap ();
Img->CloseImage(tnImgId);
// save bm - thumbnail bitmap - for later processing
}

2. Having created a bitmap containing the thumbnails as a vertical strip and displayed it in the viewer control OK, I now wish to be able to highlight a selected page's thumbnail within the bitmap, by drawing a coloured border around it. However, drawing on the underlying bitmap does not cause the displayed image to refresh and show the highlighting. I have tried Redraw() and Refresh() but neither seems to have any effect. The only way I have found to force the image to re-display is to programatically scroll the image up one pixel and then back again. It works but the little jitter does not look very professional. How should I achieve this in a more sophisticated way, please? Does the viewer retain a second image containing just what is displayed, which is only updated when it needs to change (by scrolling)? An outline understanding of the internal workings would be a great help.

3. The above process seems to give rise to a number of temporary files (at least one per page) which have (so far as I can see) randomly selected names. These are not automatically deleted. How can these be identified and deleted on exit from the application, please?

Best Regards,

David
dapedley
 
Posts: 11
Joined: Fri Feb 08, 2008 6:19 pm

Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest