ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to update thumbnail with the main image
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  


1 Posts

Posted - Oct 15 2020 :  04:38:23  Show Profile  Reply
Hi All,

I am using the code below to crop an image and then to resize the image. This is working fine. The only issue I have is it doesn't seem to update the thumbnail. I ran the code and then checked the images in windows explorer. At first I didn't think it had worked, as all the images were the same. But when I opened the image, it was cropped and resized correctly.

How do I make sure the thumbnail is also updated?


// imgDest is a TImageEnView

    //crop and resize file
    Crop_Margin := eSize.Value;
    imgRect := imgDest.Proc.AutoCrop( 0, clWhite, False );
    imgDest.Proc.Crop( max( imgRect.Left - Crop_Margin, 0 ),
                    max( imgRect.Top - Crop_Margin, 0 ),
                    min( imgRect.Right + Crop_Margin, imgDest.IEBitmap.Width ),
                    min( imgRect.Bottom + Crop_Margin, imgDest.IEBitmap.Height ) );

    w := FltToInt(eWidth.Value);
    h := FltToInt(eHeight.Value);
    if eFilter.Itemindex <> -1 then begin
      if (w > 0) and (h > 0) then begin
        imgDest.Proc.Resample(w, h, TResampleFilter(eFilter.Itemindex));

    // save destination file


6144 Posts

Posted - Oct 15 2020 :  15:47:30  Show Profile  Reply

You may need to force windows to refresh the thumbnail with

The other possibility is that the image contains a thumbnail and Windows is using that. So you should update the thumbnail:

Xequte Software
Go to Top of Page


67 Posts

Posted - May 11 2021 :  12:52:54  Show Profile  Reply
A little late, but might help others. This worked for me using Delphi 10.4.2:
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATHW or SHCNF_FLUSH, Pointer(fImageFilename), nil);

Where fImageFilename is a string and is the path to the jpg file I had just edited.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: