Carthaigh Posted April 27, 2009 Share Posted April 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted April 27, 2009 Share Posted April 27, 2009 Here is the overview on how Paint.NET plugins work: Paint.NET Plugin Overview There are a ton of examples of plugins on this page: Paint.NET Plugin Examples If you want more than just code examples, try this series of tutorials: Part 1 - SimplePart 2 - IntermediatePart 3 - ComplexPart 4 - Odds & Ends 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: Building a DLL with CodeLab 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. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Carthaigh Posted April 27, 2009 Author Share Posted April 27, 2009 Perfect, thanks! I appreciate all the information you've made available by the way. I've just been somewhat stymied because my 9-5 blocks googlepages and box.net and when I say 9-5 I really mean more 8-8. Thanks again. Quote Link to comment Share on other sites More sharing options...
SeriousSam Posted May 23, 2009 Share Posted May 23, 2009 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 Quote Link to comment Share on other sites More sharing options...
Hindol Posted March 6, 2011 Share Posted March 6, 2011 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. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted March 6, 2011 Share Posted March 6, 2011 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: Building a DLL with CodeLab 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. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 6, 2011 Share Posted March 6, 2011 You can also use Reflector to poke around and see how the built-in effects are implemented. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
pyrochild Posted March 7, 2011 Share Posted March 7, 2011 You can also use Reflector to poke around and see how the built-in effects are implemented. Quick, before Red Gate starts charging money for it! Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted March 7, 2011 Share Posted March 7, 2011 I've seen that news . When does that start? Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Simon Brown Posted March 7, 2011 Share Posted March 7, 2011 Quick, before Red Gate starts charging money for it! JetBrains are adding a similar feature to ReSharper and creating a free tool. I'm not sure what they mean by "to explore whatever .NET compiled code is legal to explore," though. I've seen that news . When does that start? 30th May Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 8, 2011 Share Posted March 8, 2011 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. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
pyrochild Posted March 8, 2011 Share Posted March 8, 2011 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! 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. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Simon Brown Posted March 8, 2011 Share Posted March 8, 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? 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.