Jump to content
How to Install Plugins ×

CodeLab v6.12 for Paint.NET 5.0.12 (Updated February 11, 2024)


Rick Brewster

Recommended Posts

  • 4 weeks later...

Here's a codelab source that might make a great fractal starting point: viewtopic.php?p=109686#p109686

Link to comment
Share on other sites

I'm using CodeLab with Paint.NET 3.5 Beta 1 on Windows Vista 64-bit.

I am encountering a problem after adding a 'Drop-Down List Box' or a 'Radio Button List'.

When I select 'File | Save as DLL ...' and then click 'Build', I get the following error message:

'PaintDotNet.Utility.ClampToByte(int)' is obsolete: 'Use the ClampToByte() extension method instead' (CS0619).

This also happened with the Paint.NET 3.5 alpha builds.

Does anyone know of a workaround?

Link to comment
Share on other sites

You can also use Int32Util.ClampToByte(x).

The Utility class is being deprecated. It will still be there for older plugins, but new code should never use it (when possible).

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

Yes, it is CodeLab that is generating the code that causes the error:

'PaintDotNet.Utility.ClampToByte(int)' is obsolete: 'Use the ClampToByte() extension method instead' (CS0619).

Link to comment
Share on other sites

  • 1 month later...

Are there any plans for creating an intellisense-like menu for codelab?

yhsjjie.png

History repeats itself, because nobody was paying attention the first time.

Link to comment
Share on other sites

Are there any plans for creating an intellisense-like menu for codelab?

I have no plans for it myself. But, 2 different people have approached me about adding it. Neither has caughed up any code though. So, if you want to tackle it... Go for it!

Download the source code from my site. If you get something working, send it to me and I'll put it into the official build.

Link to comment
Share on other sites

  • 1 month later...

Hey Boltbait, would it be possible for you to add functionality to disable the constant 'running of the effect' while writing the code? It freezes up Paint.NET for about one or two seconds and when you are mid-line of code it can become quite the nuisance. Thanks, and a Merry Christmas!

- Mike

signature.png

Link to comment
Share on other sites

Just add a nonsense line somewhere in the code to prevent it from compiling, then remove it when you want to test.

EDIT: I just use a '!'

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

Recently a very simple thought stoke me - we can't use different layers in scripting, but we can use different parts of the image with rectangular selection. Here is example of using 3 "layers".

    int w=(selection.Right-selection.Left)/3;
   for (int y = rect.Top; y < rect.Bottom; y++)
   {
       for (int x = rect.Left; x < rect.Right; x++)
       {
           if (x=selection.Left+2*w)
           {
               continue;
           }
           //here we can change only middle part of the image using left and right "layer".
      }
   }
}

For non-rectangular selections offsets of "layers" have to be passed via parameters.

Link to comment
Share on other sites

Recently a very simple thought stoke me - we can't use different layers in scripting, but we can use different parts of the image with rectangular selection. Here is example of using 3 "layers".

That's a limitation to Paint.NET's effects API, not CodeLab.

KaHuc.png
Link to comment
Share on other sites

  • 2 weeks later...

Hi, I'm a total n00b and I'm having trouble getting a code to work right. Where do I go to ask someone what to do if I'm having trouble with a codelab code?

Also, is there a library of different functions in codelab?

Edit: nvm, most of the functions are in the source code.

Link to comment
Share on other sites

OK, well in the mean time, just use Paint.NET 3.36 for plugin development.

In case it helps, here's a version of the excellent CodeLab plugin that I've updated to work with the latest version of Paint.NET (3.5.2 as of writing)...

I've just updated it to use the Int32Util.ClampToByte method for listboxes and radio boxes so now compiles plugins correctly again.

I.e. line 1337 and 1348 to read....

PropertyPart += "            this.Amount" + x.ToString() + " = Int32Util.ClampToByte((int)newToken.GetProperty(PropertyNames.Amount" + x.ToString() + ").Value);\r\n";

(Also upgraded to .NET 3.5 framework so it could be recompiled)

I have to admit, this CodeLab is fantastic! I'm having so much fun with it!

Link to comment
Share on other sites

CodeLab has been updated.

Grab your copy here: http://www.boltbait.com/pdn/codelab/

- Added window title customization

- Script comment parsed for default window title:

// Title: Your window title here

- Fixed Radio Button List control type

Your effects can now have customized title bars. Enjoy.

BTW, this new build works with PdN 3.36+

Link to comment
Share on other sites

I'm sorry if this question has already been answered, but,

Can you read RGBA values on other layers? How?

You can not. It is a limitation of the Paint.NET plugin system that you are limited to reading only pixels on the currently selected layer.

This may be fixed in a future version of Paint.NET, but don't hold your breath waiting for it.

Link to comment
Share on other sites

Thanks for the quick reply, too bad.

Anyways, that leads to Sarkut's question.

Could a plugin use RGBA values on one other layer

if it is pre-loaded to the Windows clipboard?

I figure that is more likely, but...it all depends on how the program's clipboard is built (because codelab uses an include code for part of the code).

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