Jump to content

Plugin Development Primer


Recommended Posts

How do you get started writing Paint.Net plugins for effects and tools?

I'm an experienced programmer and have been in .Net since beta so I'm looking for as much tech info as possible so I can try my hand at some plugins. I've done a fair bit of reading so far including going to BoltBait's site and looking into the CodeLab feature he's maintaining now but how about writing native, from-scratch C# plugins? Is there an API somewhere? Are there coding examples I'm missing. I saw a post from a while ago that suggested some of this was available off of the download page on getpaint.net but I don't see it there.

I'm not looking to be spoon fed here but since I haven't been able to find the resources any help would be appreciated.

Sig.png
Link to comment
Share on other sites

Here is the overview on how Paint.NET plugins work:

There are a ton of examples of plugins on this page:

If you want more than just code examples, try this series of tutorials:

If you really want to know the "bare bones" C# way of writing a plugin, load one of those examples into CodeLab, press Ctrl-B to build a DLL file, and click the "view source" checkbox before pressing the Build button... as shown in this page:

This will show you the entire C# file used to build a Paint.NET plugin. You can select that source code and copy-and-paste it into a separate .cs file and open it in VS2005.

Link to comment
Share on other sites

  • 4 weeks later...

Carthaigh, I am a .net programmer as well and have released a few plugins and source code. I have been using vs2008 c# express. For SpriteSheet Plugin viewtopic.php?f=16&t=30121 or Convolution Filter viewtopic.php?f=16&t=29798.

If only a simple GUI is needed I found deriving a class from PropertyBasedEffect is best way to go. It has support to generate the Dialog box from from the properties passed to it. BoltBait's burnator source attached is good example. The entire project is 1 cs file ~200 lines of code!

Otherwise, use the template project to create own dialog. I would recommend taking a look at the How to Debug sticky if you are not familiar with debugging a dll. It takes a little work with express edition :wink: .

BoltBaitBurninate.zip

Link to comment
Share on other sites

  • 1 year later...

1) Is there an introductory tutorial on how to use Visual Studio for plugin development? I expected an SDK or something similar. I am finding it very hard to debug code with CodeLab.

2) Is there a way to pack-in multiple plugins (all related) within a single DLL?

Any help appreciated. Excellent software you have created by the way. I have written some image processing stuff in C++ using the amazing FreeImage library. Now I want to port all those code to Paint.NET and release them as a plugin.

Link to comment
Share on other sites

If you really want to know the "bare bones" C# way of writing a plugin, load one of those examples into CodeLab, press Ctrl-B to build a DLL file, and click the "view source" checkbox before pressing the Build button... as shown in this page:

This will show you the entire C# file used to build a Paint.NET plugin. You can select that source code and copy-and-paste it into a separate .cs file and open it in VS2005.

Codelab really is the easiest system to learn to code plugins. If you're having trouble, why not post your code and let others have a look-see?

BoltBait gave a list of instructions (find it in the VS template thread) as to how to use the template. There are a couple of other threads on migrating from Codelab to VS, but that list of instructions should get you started.

Yes you can pack multiple effects into a single *.dll. This has been tried many times, and users always ask for the effects to be separated so they can pick and choose which they install. If you want to release a single package, zip the separate dll files.

Link to comment
Share on other sites

I've seen that news :(. When does that start?

Link to comment
Share on other sites

Quick, before Red Gate starts charging money for it!

It's only $35 though ... hardly expensive :) Plus, is the new paid version going to nuke all the old free installs out there? I hope not, and I doubt it.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

It's only $35 though ... hardly expensive :) Plus, is the new paid version going to nuke all the old free installs out there? I hope not, and I doubt it.

http://www.red-gate.com/products/dotnet-development/reflector/announcement-faq :

"How much longer will I be able to obtain and use a free version of .NET Reflector?

A free version will be available for download until the release of Version 7, scheduled for early March. The free version will continue working until May 30, 2011."

So it sounds like there's a self-destruct in there. The question is, how long has it been in there, how long have they been planning this? We should Reflector it and find out! :lol:

If they have been including a time-bomb, then that really disgusts me, and I piss on Reflector's grave.

And while $35 may not be a lot to a professional software developer, it is a huge portion of my donation income.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

So it sounds like there's a self-destruct in there. The question is, how long has it been in there, how long have they been planning this?

Before they acquired Reflector, the original author put the time bomb in to force people to always use the latest version.

http://www.zdnet.com/blog/burnette/red-gate-we-could-not-make-the-free-model-work-for-us-as-a-commercial-company/2176

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

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