Explorer get thumbnail image very fast, how does it work?

I am using explorer to view the image in thumbnail view. Very quickly get a thumbnail of each image (bmp, jpg).

I am using the following code to create thumbnails for each image. however, it is much slower than conductor. How can I write a piece of code to generate sketches as fast as system and accurate (the sketch generated by the following code sometimes has a black bar on top and bottom or left and right, I don't know why ...). Or can I declare the explorer API for sketching using its function?

Bitmap sourceImg(xxx);
int nSize = sourceImg.GetPropertyItemSize(PropertyTagThumbnailData);
if(nSize > 0)
    {
    PropertyItem * pItem = (PropertyItem*)malloc(nSize);
    if (pItem != NULL)
    {
        sourceImg.GetPropertyItem(PropertyTagThumbnailData, nSize, pItem);
    }
    GenerateThumbnail from pItem.....
}

      

+2


source to share


2 answers


Explorer is probably using Exif inline jpg thumbnail.



Take a look at a simple Exif Image Viewer to confirm that the images you are using contain an embedded thumbnail.

+1


source


For me, Explorer creates thumbnails painfully slow. My own code is much faster for sketching. The problem I am facing is that FindFirst / FindNext are slow compared to Explorer because it uses the "file object" system instead of the "file name" system. I would like to find a quick code to get the filenames in directories.



+1


source







All Articles