Jump to content

CodeLab v6.8 for Paint.NET 5.0 (Updated January 22, 2023)


Recommended Posts

I'm getting the following exception when trying CodeLab 6.7 on the new Paint.NET Beta 5.0:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at ScintillaNET.Scintilla.DirectMessage(Int32 msg, IntPtr wParam, IntPtr lParam)

Crash log is attached.

pdncrash.12.log

Edited by kuenzign
Added crash log
Link to comment
Share on other sites

On 12/10/2022 at 9:37 AM, sergiopedri said:

@BoltBait would you consider publishing CodeLab in the Microsoft Store? Not only you'll get an easier way for people to get it and to receive installs, but also you'll get the Store to sign the application for you for free 🙂

 

A developer license costs 19$ (just once) and gives you unlimited code signing use 😄

 

I believe Paint.NET-in-the-Store has to be set up for this first. That is, having a secondary plugin catalog that comes from Store-installed packages.

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

8 hours ago, _koh_ said:

Theme: Auto doesn't reflect PDN setting, need to set CodeLab theme separately.

 

Yes, this has already been fixed for the next release.

 

8 hours ago, _koh_ said:

Auto update tries to update CodeLab v6.7 to CodeLab v6.6.

 

Good thing there's nothing "Auto" about the update check; it's just a notification to download. 😉

You're right though, this can be improved.

 

EDIT: update checking has been improved for the next release of CodeLab.

Edited by toe_head2001
  • Like 1
Link to comment
Share on other sites

I'm trying to compile an example for Double Vector from @BoltBait's Sample Code for User Interface Elements.

Spoiler
// Author: Curtis
#region UICode
PanSliderControl Amount1 = Pair.Create(0.0,0.0); // Position
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{
   Rectangle selection = EnvironmentParameters.SelectionBounds;
   ColorBgra PrimaryColor = EnvironmentParameters.PrimaryColor;

   int width = selection.Right - selection.Left;
   int height = selection.Bottom - selection.Top;

   // converts the Pair values to between 0 and 1
   // where 0 is the left/top and 1 is the right/bottom.
   double px = (Amount1.First + 1) / 2;
   double py = (Amount1.Second + 1) / 2;

   // we can now convert these to actual pixel co-ordinates.
   int column = (int)Math.Round(px * width);
   int row = (int)Math.Round(py * height);

   for (int y = rect.Top; y < rect.Bottom; y++)
   {
      for (int x = rect.Left; x < rect.Right; x++)
      {
         if (x == column || y == row)
         {
            dst[x,y] = PrimaryColor;
         }
         else
         {
            dst[x,y] = src[x,y];
         }
      }
   }
}

 

I replaced Amount1.First and Amount1.Second with Amount1.X and Amount1.Y . Is this replacement correct?

Link to comment
Share on other sites

3 hours ago, ReMake said:

I replaced Amount1.First and Amount1.Second with Amount1.X and Amount1.Y . Is this replacement correct?

 

Yes, but you also need to change the Amount1 declaration.

 

PanSliderControl Amount1 = new Vector2Double(0.000, 0.000); // Position

 

  • Upvote 1
Link to comment
Share on other sites

Is there currently a solution for using the Black-and-White Clouds effect in CodeLab v6.7?

 

Spoiler
// Clouds
    // Use this line instead of the next for Black-and-White clouds:
    cloudsEffect.EnvironmentParameters = new EffectEnvironmentParameters(ColorBgra.Black, ColorBgra.White, 0, EnvironmentParameters.DocumentResolution, EnvironmentParameters.GetSelectionAsPdnRegion(), src);
    //cloudsEffect.EnvironmentParameters = EnvironmentParameters;
    cloudsProps = cloudsEffect.CreatePropertyCollection();  

 

 

Replacing EffectEnvironmentParameters() with CreateFrom() requires a using directive or an assembly reference?

Link to comment
Share on other sites

You if only care about Black for Primary and White for secondary, you can use the DefaultParameters.

 

cloudsEffect.EnvironmentParameters = EffectEnvironmentParameters.DefaultParameters;

 

@Rick Brewster

In Pdn v5, the EffectEnvironmentParameters constructor was marked as obsolete. Since it's part of the Legacy effect system, are you willing to roll back that change until the entire legacy effect system is killed off?

  • Upvote 1
Link to comment
Share on other sites

You're trying to create an EEP who's primary/secondary color are specifically set to Black and White?

 

(a better pattern here is that the Clouds effect should just take the colors as property values -- but we can't go back in time and change that!)

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

  • 4 weeks later...

CodeLab v6.8 Released

This is only for Paint.NET 5.0+!

 

Quick update today...

 

Just a release of random stuff before we start tackling support for Paint.NET 5.0+ (UI tabs and GPU acceleration)

 

Changes:
 Fix crash in UI Designer preview screen (toe_head2001)
 Minor code refactoring and bug fixes (BoltBait and toe_head2001)

 

Grab the CodeLab DLL here:

 

https://www.boltbait.com/pdn/CodeLab/

 

  • Like 4
  • Hooray 1

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

  • Rick Brewster changed the title to CodeLab v6.8 for Paint.NET 5.0
  • BoltBait changed the title to CodeLab v6.8 for Paint.NET 5.0 (Updated January 22, 2023)

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.

 Share

×
×
  • Create New...