Link to home
Start Free TrialLog in
Avatar of TelDig
TelDigFlag for Canada

asked on

Add large data chunk in a .PNG image using C#

Hi,

I need some opinion and tips. We are having a "drawing tool" that save to .png file but now we need to keep track of some vectorial data.

We get in the idea of adding a "data chunk" but we are note familiar with the format itself. We found that Adobe fireworks seem to do that kind of trick. Defining our own file format get things more complicated and lot less user firendly, the file cannot be emailed and need to "teach" file format differences.


- Do you find this an acceptable solution?
- Any tips or c# library that can help to add and reread our data insinde the png
- Any chunk size limitation?

Thanks
Avatar of hjgode
hjgode
Flag of Germany image

I would not go with a new format. You may either select one of the compound graphic file formats, like EPS, or, what I prefer, save the vector data in a separate file with the same name.
To save the vector data, you need to keep an array of drawing commands and then 'translate' these commands to svg, eps or similar drawing file.
If you can translate the drawing to eps (postscript) you may also use a pdf file for export/import, see the iTextSharp library.
Avatar of TelDig

ASKER

The issues here is that we must keep a flat image format (ex: png or jpeg)
You cannot use a bitmap file to store vector data. So either you go with two files (most comaptible) or hybrid file format (pdf) or possibly add your drawing data at the end of the png/jpg file. I do not know, what happens with apps, when they open a file with added file data at end of normal file.
ASKER CERTIFIED SOLUTION
Avatar of TelDig
TelDig
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TelDig

ASKER

My question / My answer