Page 1 of 1

Keeping PNGs as PNGs in HML export

Posted: Mon May 09, 2016 10:19 pm
by EricNat
We have a legacy app on BDS 2006 that we have not had the time to upgrade yet. In an HTML export from TRichView, all of the embedded images are converted to JPG. The PNGs fail in this conversion, presumably because it's not supported on BDS 2006 C++ Builder. I have added the PNGImage unit to the code and tried:

RVGraphicHandler->RegisterHTMLGraphicFormat(TPNGObject);

To get it to save the PNGs as native PNGs instead of trying to convert them to JPGs.

This will not compile - "Improper use of typedef 'TPNGObject'" is the error. I tried wrapping it in a __classid(). This compiles but it's still attempting to convert the PNG images to JPG.

Can someone help? We would like the PNGs to just stay as PNGs.

Thanks

Posted: Tue May 10, 2016 6:27 am
by Sergey Tkachenko
For C++, the code is

Code: Select all

RVGraphicHandler->RegisterHTMLGraphicFormat(__classid(TPNGObject)); 
It must work.
If it does not, please send me a simple project reproducing the problem.