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
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 C++Builder example for TIEDictionary?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

EricNat

USA
37 Posts

Posted - Oct 07 2022 :  09:21:40  Show Profile  Reply
I am trying to set the maximum compression on a WEBP save using the ImageMagick plugin. Having trouble getting this Delphi code converted to C++Builder. Specifically, I can't seem to find a Create() method for TIEDictionary. I tried creating it with "new" as well but that didn't work either.

ImageEnView1.IO.LoadFromFile( 'D:\Image.png' );
imDict := TIEDictionary.Create(); // HAVING TROUBLE CONVERTING THIS LINE TO C++
imDict.Insert( 'webp:lossless', true );
imDict.Insert( 'webp:method', 0 );
imDict.Insert( 'webp:auto-filter', true );
ImageEnView1.IO.Params.Dict.Insert( 'ImageMagick', imDict );
ImageEnView1.IO.SaveToFile( 'D:\Image_out.webp' );

Thanks,
Eric

xequte

38182 Posts

Posted - Oct 07 2022 :  19:31:47  Show Profile  Reply
Hi Eric

This did not work?

imDict = new TIEDictionary;

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

EricNat

USA
37 Posts

Posted - Oct 09 2022 :  14:38:59  Show Profile  Reply
no, I get an error:

[bcc32 Error] Main.cpp(144): E2285 Could not find a match for 'TIEDictionary::TIEDictionary()'

When I try that.

Thanks.
Go to Top of Page

xequte

38182 Posts

Posted - Oct 10 2022 :  17:19:38  Show Profile  Reply
Hi Eric

It looks like the C++ definition for TIEDictionary doesn't recognize Delphi default parameters, so they must be specified manually:

imDict = new TIEDictionary(103, false);

Note: hyieutils.hpp must be included ( #include "hyieutils.hpp")

We'll improve this for the next release.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

EricNat

USA
37 Posts

Posted - Oct 10 2022 :  22:06:47  Show Profile  Reply
Thanks! That did the trick!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: