RSS Feed  March 11th, 2010

Paint.NET - Effects Plugin Template - Updated

Added: March 6th, 2007 (tagged with: coding, paintdotnet)

After a few months, I have received some feedback on my Visual Studio 2005 Paint.NET Effect Plugin Template and have made a few updates:

BoltBait wrote:

Sepcot, I would recommend the following changes to your template:

  1. Add the code from my project listed above to your template for adding the effect to a submenu. There is some code and the reference to it.
  2. The OK and Cancel buttons should be anchored bottom & right instead of top & left.
  3. Add a "// place your public variables here" and "// set your default values here" to the token file.
  4. Add a few "using" lines to open up access to various controls (like I did in the project linked above.)

Nice template, by the way! Thanks!

-- http://paintdotnet.12.forumer.com/viewtopic.php?p=24136#24136

Add SubMenu Option

To add the submenu option, I have altered the EffectPlugin.cs file as follows:

public static string StaticSubMenuName
{
    get
    {
        return null;
    }
}

public EffectPlugin()
    : base(EffectPlugin.StaticName, EffectPlugin.StaticIcon, EffectPlugin.StaticSubMenuName, true)
{

}

If you do not want to place your effect in a submenu leave as is. If you want to add to a submenu, change null to the name of the submenu you want to add your effect to: i.e. "Blurs"

Other Changes

The other changes are straight forward. I updated the OK and Cancel buttons to anchor to the bottom/right, added comments to EffectPluginToken.cs to identify where to place/set your variables, and added using PaintDotNet; to EffectPluginConfigDialog.cs to provide access to various Paint.NET controls (such as AngleChooserControl).

Note: the code contained in the template can be built as is, but it won't yield you any interesting effects. In fact, it will just render a configuration dialog box with "OK" and "Cancel" buttons that do nothing to alter the canvas.

Blank Effect Dialog

Effects Plugin Template Files

© 2006 - 2010 Michael J. Sepcot - michael (dot) sepcot (at) gmail (dot) com