BoltBait.com

Using CodeLab to Build a DLL

Make DLL files to share your effects with friends!


Before making a DLL file, you must save your source code. Select the File > Save menu item or press Ctrl-S to save your work. Select a file name and press the Save button.

Once your source code is saved and you are happy with your effect you are ready to make a perminant copy to share with your friends. Select the File > Save as DLL menu item or press Ctrl-B. You should see the following screen:


When building a DLL file, you need to specify the menu settings and the support information. Menu settings are used by Paint.NET to determine where to add your plugin into Paint.NET and how it should be shown in the Paint.NET menu. Support information is displayed to the user if your plugin ever crashes. That information can be useful to you later when trying to debug issues.


Menu Settings

Your first decision is wether to put your effect into Paint.NET's Adjustments menu or the Effects menu. Adjustments are effects that work on single pixels alone. Effects are plugins that work with multiple pixels at a time, distort the user's picture, or completely ignore the user's picture to render something completely different. Most effects go into the Effects menu.

Next, choose a submenu for your effect. The drop-down list box contains several standard choices for you. If you do not find one that satisfies you, simply type your own. If you use one of the standard menus from Paint.NET (Artistic, Blurs, Distort, Noise, Photo, Render, or Stylize) your effect will show up in the proper Localized menu when Paint.NET is running in a language other than English. If you wish your effect to show up in the main menu (not a submenu) just leave this blank.

Then, enter the text your effect should show in Paint.NET's menu. You must enter some text here.

If you would like to attach an icon to your effect's menu, click the "Select Icon" link. From the open dialog box, select a 16x16 pixel PNG image for use as the icon. Your PNG file may contain transparent areas. Please note, this will only work if the PNG file is exactly 16 pixels wide by 16 pixels tall. An icon is not required.


Support Information

Enter your name in the Author's Name box. After all, you are the author of this new effect!

Choose a version number for your effect. You can click the up or down buttons to easily select numbers. Usually the first version of an effect is 1.0 and minor updates increment the second number (1.1, 1.2, etc.) and major updates increment the first number (1.0, 2.0, etc.). The decision is completely up to you.

Finally, enter a URL where people can find out more information about your effect. The default URL in CodeLab is http://www.getpaint.net/redirect/plugins.html which is the address of the Paint.NET plugin forum.


Help

The right half of the build screen is dedicated to help content. There are 4 types of help you can choose to include: 1) no help, 2) a URL with your help content on it, 3) a simple text message--such as a copyright message, or 4) a full word processing file that may include images and "fancy" text.

First choose the level of help you wish to include and then fill out the help content. You may then press the "?" button to see what that will look like when included in your effect.


Build It!

When you are happy with all of the information entered, press the Build button. This will create your DLL file and put it into a zip file on your desktop all ready for sharing!

If you wish to make your plugin a permanent part of your Paint.NET you will need to unzip the file to your desktop and run the included "install.bat" file. After installation, when you restart Paint.NET you should see your new effect in the specified menu.

If you can't find it, check Paint.NET's Settings > Plugin Errors screen for details on what went wrong.


Defaults

In your script, you can specify defaults to the following screen fields:

The default submenu can be placed in your script by using the following:
   // Submenu: Artistic

Of course, replace "Artistic" with your desired submenu name.

The effect's menu name can be placed in your script by using the following:
   // Name: Ink Sketch

The effect's title bar text can be placed in your script by using the following:
   // Title: BoltBait's Ink Sketch - v1.0

The author's name can be placed in your script by using the following:
   // Author: BoltBait

The support URL can be placed in your script by using the following:
   // URL: https://boltbait.com/pdn

You need to place each of these alone on a line within your script for CodeLab to find them and use them.


Sharing your DLL

Once you are happy with your DLL file, you can share it with your friends. One good place to share Paint.NET Effect DLL files is at the Paint.NET effects discussion board. That is a great place to learn how to write plugins, share your discoveries, and show off your work!

You can share both your Script file and your DLL file. Just remember when posting script files on the message board to use [code] and [/code] tags around your script. Also, you should share the zip file CodeLab created for you to the Paint.NET message board.


Advanced C# Coders

Remember before that I said that you only need to write the Render loop and that CodeLab would write the rest of the code for you? Well, if you are curious what that code looks like, click the "View source" button before pressing the Build button. If you do that, CodeLab will show you all of the code that it wrote along with all of your code. Or, if you want to shift your project over to Visual Studio for additional tweeks, you can press the Generate VS Solution button. (Note: Generate VS Solution is not available if you are running on the Store version of Paint.NET, however the "View source" button and building a DLL should work just fine for you.)


More Information

Here is some more information that you may find useful:
CodeLab Effects Design Overview
Designing a User Interface for Your Effect
Sample Code for User Interface Elements
Using the Code Editor
CodeLab Help File
Check for CodeLab Updates
Learn C#



 

 
 

News



CodeLab 6.12 Released
(February 11, 2024)
This latest release of CodeLab for Paint.NET includes the ability to write GPU accelerated plugins.
More...

Double-Six Dominoes 3.1
(May 10, 2021)
This long-awaited refresh of the most popular dominoes game on Download.com is now available!
More...

HTML Editor 1.5 Released
(March 31, 2016)
This latest release is a complete rewrite adding a wysiwyg editor mode and a much improved UI.
More...