Page 1 of 1

Download an Image without PNG conversion

Posted: Wed Aug 24, 2022 4:07 am
by Rander
Hi, i have a question,

In MiniBrowser there is a "Download Image" example and it works fine, except one thing: it changes the original image.
For example the original file was in jpg, but in this example we do "image.GetAsPng" and the saved file will be:
1. Recompressed (because we take a bitmap from ICefImage and compress it in Png)
2. Saved in the wrong format

Result: size and quality of the image are wrong, sometimes critically.
Is there an option to do real "save as" or real "download" without such damage?
Thank you

Re: Download an Image without PNG conversion

Posted: Wed Aug 24, 2022 7:59 am
by salvadordf
Hi,

Try getting the image URL and then calling TChromium.StartDownload.

That will initiate a regular file download which will trigger the usual download events in TChromium : OnCanDownload, OnBeforeDownload and OnDownloadUpdated.

The MiniBrowser demo also has an example of those download events.

Re: Download an Image without PNG conversion

Posted: Wed Aug 24, 2022 8:12 pm
by Rander
thank you it is the game changer :D