Jump to content

Official documentation

Recommended Posts

Where can I find the official plugin developer documentation, that shows exactly what API my DLL has to make available to PDN, and exactly what PDN objects are available for me to use? The description of all the data types? Also I'm interesting in developing every kind of plugin, not just effects plugins. Googling just leads me to tons of sites distributing unauthorized plugin packs.

Link to comment
Share on other sites

23 hours ago, BoltBait said:

This is an excellent resource about how to write an effects plugin using CodeLab, and I'm very grateful for it. However, while this is a great starting point, it only talks about using Visual Studio as an afterthought. And it doesn't describe the object model that PDN makes available nor the functions that can be written. And it doesn't mention the other two kinds of plugins at all.

Link to comment
Share on other sites

Such documentation doesn't exist. Perhaps it should, but few people like writing documentation.


Here's rough/simplified overview:

- To make an effect, you create a class that derives from the Effect class that's in the paint.net assemblies.

- When your effect class is invoked (when you open the plugin), it spawns an EffectConfigDialog class, and EffectToken class.

-- You can define your own EffectConfigDialog and EffectToken classes, or IndirectUI will do it for you (if you derive from PropertyBasedEffect instead of Effect)

- When you change something in the GUI (the EffectConfigDialog), the value from the GUI control gets bound to a property in the EffectToken.

- When the method in your effect executes, it fetches the values of the EffectToken properties, and uses them as the variables in your code that manipulates the image.


^^^^ I should really turn that into a nice chart.


Here are some of the Types you should be familiar with:

- ColorBgra - very similar to Color, but different structure, and provides some useful methods

- Surface - represents a collection of BgraColor pixels. Individual BgraColors in a Surface can be accessed like this MySurface[x, y]

- RenderArgs - Not really sure how to describe this one. It's like a container for Surfaces...

- PdnRegion - similar to a Region. Usually utilized to define the exact selection, as they can be complex sometimes.

  • Upvote 2
Link to comment
Share on other sites

Well, sorry, but my tutorials are about as official as you're going to get.  But, you're right, they are not complete.


I'm not part of the paint.net development team, but I started writing tutorials as I began understanding how plugins worked as a way to help others.  And, as there was no official documentation, I worked with the early plugin developers to understand the limits and capabilities of the plugin system.  (You can still read the CodeLab thread from the beginning to chart my progress.)


As for other types of plugins, I've never written a filetype plugin.  But, you can be sure that if I ever do, I'll be sure to write a tutorial on how to do it. :)


The only other type of plugin is "shapes" and you can find information on how to design and code custom shapes here:


Since you feel that the current set of documentation is lacking, you can write some yourself!  Play with paint.net, tinker, figure out how it works, then write down what you found!  That's what I did and you can do the same.  I'm sure there are many people who would benefit from any tutorial you care to write.

  • Upvote 1

Click to play:
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

Here's a chart I made. It shows IndirectUI effect plugins, and also custom effect plugins.  Any Corrections are welcome and encouraged.


Blue Rectangles: Base Classes you derive from.

Black Ellipses: Classes you create

Green Ellipses: Classes IndirectUI creates "behind the scenes"


Blue Lines: Shows class derivation (show the base class)

Red Lines: Shows the flow of Token values

Black Lines: Shows Classes being invoked from other classes




  • Upvote 2
Link to comment
Share on other sites

I like that @toe_head2001! If you added the info from your previous post it the chart would be awesome

Link to comment
Share on other sites

Thanks @toe_head2001. This has real potential. I might have a play with it over the coming weekend.

Link to comment
Share on other sites

Thanks but I'll just fiddle with it in paint.net.

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...