ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Replacing/Removing a PNG TextKey?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Sep 01 2024 : 08:07:33
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?

1   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Sep 01 2024 : 08:33:09
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.