Where Are All The Pretty Graphics?

CodeLab documentation

December 1, 2018   -   Filed under: CodeLab

I’ve created some work-in-progress documentation for CodeLab. This covers the actual features of CodeLab; nothing code related. It is written in markdown files, and then MkDocs is used to build those files into a website.


Each page has an edit icon in the top right corner. Feel free to fill in any missing content. A GitHub account to required to submit changes though.

CodeLab v3.0

January 10, 2018   -   Filed under: CodeLab

CodeLab v3.0 was released today by BoltBait, and it’s a hefty update full of new features.  NB: it requires paint.net v4.0.20+.
With version 3, we have, by far, the most robust development environment of any image manipulation program.
Here are some of the features I contributed for today’s release:

OnSetRenderInfo can be optionally utilized via the PreRender method

Previously, if you wanted to use OnSetRenderInfo(), you’d have to export your script to Visual Studio. CodeLab is now smart enough to execute SetRenderInfo. You can utilize this by placing your relevant code into a PreRender() method that looks like this:

void PreRender(Surface dst, Surface src)

Dark Theme + Paint.net Dark Theme

Complementing the Dark editor theme I added in v2.22, today’s release of CodeLab can inherit paint.net’s UI theming. That is to say, the entire CodeLab UI can have a dark theme applied to it.  All you have to do is enable the Dark Theme in paint.net’s settings.

Find & Replace floating panel

The new ‘Find & Replace’ is a non-modal panel anchored to the top-right corner of the editor. This allows you to scroll around and edit your code while performing search operations.  The new panel also exposes the optional search flags: Match Casing, Match Whole Word, Regular Expressions, and Interpret Escape Characters.

Format Document

This performs automatic line indentations, and end-of-line whitespace trimming.

Introspective – Intelligent Assistance for UserScript

CodeLab has provided ‘Intelligent Assistance’ features for Types (and their members) for a while now. The ‘Intelligent Assistance’ features include Tooltips, AutoCompeletion, and usage highlighting. It seemed rather silly when I realized we didn’t provide these features for the current script in the editor (aka the UserScript). You now get all the ‘Intelligent Assistance’ features for your own methods, fields, properties, ect.

AutoComplete Box filtering

The AutoComplete Box can now be filtered by object type (classes, enums, structs, properties, consts, methods, ect.).

Here are the keyboard commands to invoke filtering within the AutoComplete box:
Alt+L    Local Variables and Parameters
Alt+O    Constants
Alt+P    Properties
Alt+F    Fields
Alt+M    Methods
Alt+C    Classes
Alt+S    Structs
Alt+E    Enums
Alt+K    Keywords

Go To Definition

Press F12 to ‘Go To Definition’. Objects from the .Net Framework open the associated page on docs.microsoft.com; objects from UserScript go to location in document. Objects from paint.net assemblies do nothing, as official paint.net documentation doesn’t exist.

Intelligent Assistance in CodeLab 2.20

June 4, 2017   -   Filed under: CodeLab

This all started with me just wanting to add support for Ctrl+J in CodeLab. I had to refactor the auto completion code a bit in order to add that feature.

After I got it working, I realized the refactoring I had done would make it much easier to add support for Non-Member (Types, variables, keywords, ect.) auto completion.

I also added support for Highlighting word usage. To ensure matches, it compares spelling, casing, and word type (Type, Property, Field, Method, variable).

Bonus feature: I’ve also added Snippets for the following: if, else, switch, while, for, foreach, using.
Place the text caret on the right side of the word and press the Tab key (or press Tab twice when in the IntelliBox).


Unofficial Changelog:

– More robust detection of variables (can deal with multiple spaces between Type and variable name. Won’t parse variables in code comments)
– Added ‘Get’ & ‘Set’ to the IntelliBox tooltips for properties
– The IntelliBox can be invoked by pressing Ctrl+J
– The IntelliBox will no longer erroneous display when working within code comments
– Highlight word under the caret. Must match spelling, casing, and word type (Type, variable, property, method, ect.)
– Smarter commenting of code blocks (even when lines have varying indentations, the ‘//’ will vertically align. Empty lines are ignored)
– IntelliBox now works with array Types (ex: int[], string[]) members
– IntelliBox for Type constructors (doesn’t actually do any auto completion, but it will show the different constructors available)
– Added Snippets for a few keywords
– Fields can now be further differentiated as Constants or Enum Items.
– LOTS of code cleanup, bug fixes, and refactoring


The update is available from BoltBait on the official paint.net forum.

A Script Kiddie’s Guide to CodeLab

April 16, 2017   -   Filed under: CodeLab

In the hopes of getting more people to use CodeLab, I wrote a guide aimed at Script Kiddies. It goes over all the things a non-programmer can do with CodeLab.

The guide is up on the official paint.net forums: CodeLab for average users – A Layman’s Guide

CodeLab v2.19 released

April 15, 2017   -   Filed under: CodeLab

Back in the days of CodeLab v2.17, I contributed a new feature that displayed Error Messages (as tooltips) directly in the code editor. Unfortunately, there was a small bug with that feature: Given the right circumstances, it could crash paint.net.

This crashing bug went unnoticed (or at least unreported) for many months. CodeLab v2.18 was even released before it was reported. Not enough people are using CodeLab on a regular basis! :(


Anyways, v2.19 was released today, and it finally fixes the bug.

Another nice change I added in v2.19 is filtering of the IntelliBox (autocomplete box). As you type, items in the IntelliBox now filter to show only matching items.

^Here the IntelliBox has been filtered to only show items containing “gold”. Since the Gold item starts with “gold”, it is automatically selected.


For the full changelog, and to download, see BoltBait’s post on the official paint.net forums.