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
 Replacing/Removing a PNG TextKey?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

914 Posts

Posted - Sep 01 2024 :  08:07:33  Show Profile  Reply
Following the example in the documentation:
https://www.imageen.com/help/index.php?topic=TIOParams.PNG_TextKeys&m=8

...we can add a PNG_TextKey with its value:

ImageEnView1.IO.Params.PNG_TextKeys.Add('Author');
ImageEnView1.IO.Params.PNG_TextValues.Add('Letizia');


But when doing this to the SAME PNG file again with another PNG_TextValue:

ImageEnView1.IO.Params.PNG_TextKeys.Add('Author');
ImageEnView1.IO.Params.PNG_TextValues.Add('Peter');


...it just ADDS a new PNG_TextKey with another PNG_TextValue to the PNG file, leading to inconsistency.

How can I remove the old TEXTKEYS and TEXTVALUES both from IO.Params and from the PNG file itself, so I can OVERWRITE the old TEXTVALUE in the PNG file?

PeterPanino

914 Posts

Posted - Sep 01 2024 :  08:33:09  Show Profile  Reply
This solved the problem:

Before adding any TextKeys and TextValues, I execute:

IO.Params.PNG_TextKeys.Clear;
IO.Params.PNG_TextValues.Clear;

This also overwrites any previous TextKeys and TextValues in the PNG file.

I could have probably targeted the specific TextKey-TextValue pair and replace that pair. However, I use only that specific pair in my application.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: