Jump to content

Preserving "Metainformation" between Load and Save

Recommended Posts

This is my first plugin for Paint.NET. I modified the DdsFileType sources, till I was able to load/save a proprietary file format.

I have still a particular problem:

For every file, my plugin creates some layers on the fly during the load process. Number and order depend on the sources content. So, I have to do a bit bookkeeping about the creation process. The gathered file-specific information becomes essential later for the saving step, because I cannot extract them exclusively from the Document.

So, how can I "link" this additional information (a list of integers in my case, but could be anything) to a document? I'm currently not able to see the way, how Paint.NET maintains more than one open document. When it comes to the FileTypes OnSave function I don't know, which particular document triggered the call and my "Metainformation" is lost.

I'm not yet in the effect plugins, but I guess, my problem reappears there. So more in general - how can I maintain access to document-specific user-defined information during the whole workflow?

BTW, what are these SaveConfigToken based classes for?

To be fair, I'm kind of a newbie in C#/.NET (but a seasoned C++ programmer). Quite possible, I'm missing something rather simple.

Link to comment
Share on other sites

Perhaps the posting was too unintelligible. Anyway, to give myself an answer to the question:

I was able to solve the problem by inheriting a customized class from BitmapLayer, carrying the necessary information. Adding such objects to the documents layer list did the trick.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...