Jump to content

CodeLab v6.4 (for advanced users) Released November 20, 2021


Recommended Posts

This just started happening. I have built several plugins in codelab, so I know what I am doing.

I was building the HSVInvert plugin from Boltbait's tutorial and found this anomaly (another one). Before building the DLL, I created the 150X200 HSVInvert.png and placed it in the same folder as the CS file. When I selected File/Build DLL I got the first error message telling me the .png must be 16X16. Clicking OK took me to the build screen, but no 150X200 .png was showing. I double checked to ensure it was in the same folder. It was. At this time the icon started showing up next to my selection in the drop down menu next to HSVInvert. How can that happen if I haven't built the DLL?

 

Here's a pic to show you what I am seeing. 

 

Flames.cs also shows up and has a 150X200 .png built, but it doesn't show up as an icon. That was the last DLL I built. I haven't even built the HSV Effect.

 

Yes - I forgot to name it HSVInvert.sample.png

 

Edited by AndrewDavid
Removed pic

qG3vze.png

 

Link to comment
Share on other sites

10 minutes ago, AndrewDavid said:

How can that happen if I haven't built the DLL?

 

Here's the code used for icon detection.

 

string imagePath = Path.ChangeExtension(scriptPath, ".png");
if (File.Exists(imagePath))
{
    recentItem.Image = UIUtil.GetBitmapFromFile(imagePath);
}

 

As you can see, your .png file will be used if it has the same name as your .cs file.

 

https://forums.getpaint.net/topic/880-codelab-v63-for-advanced-users-released-september-27-2021/?do=findComment&comment=535123

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
3 hours ago, BoltBait said:

CodeLab v6.4 is released to support version 4.3.3+ of Paint.NET.

Tested, Tried and True. Created a codelab build with a RTF file - exported to VS2022 - cleaned up the code (12 Issues), built the DLL, tested in Paint.

You would almost think I know what I'm doing.

 

Now - I would imagine adding Form Based to Codelab is practically impossible or a monumentis challenge

 

I have so many issues trying to build a Forms based plugin in VS.

I know they are a challenge, but they shouldn't be this difficult without a Template (Hint Hint)

 

Could someone create 1 small form based plugin in VS2022/Net 6.0 to experience some of the issues I have encountered.

It doesn't have to really do anything, just get it to display properly. I'll put it on my XMas wish list. :)

 

qG3vze.png

 

Link to comment
Share on other sites

I wouldn't say blindly. Issues like simplifying, value is null, removing unnecessary references. The yellow warnings. 

I have one example that I didn't modify.

 

       private void OnWindowHelpButtonClicked(IWin32Window owner, string helpContent)

 

Severity    Code    Description    Project    File    Line    Suppression State
Message    IDE0060    Remove unused parameter 'owner'    ZoomBlurDeluxeEffect    C:\Users\Andrew\Desktop\MyVS2022Plugins\ZoomBlurDeluxe\ZoomBlurDeluxeEffect\ZoomBlurDeluxe.cs    160    Active
 

Removing owner just leads to more issues. Project compiles and works correctly.

 

qG3vze.png

 

Link to comment
Share on other sites

6 hours ago, AndrewDavid said:

private void OnWindowHelpButtonClicked(IWin32Window owner, string helpContent)

 

The issue with this method is that it's called via reflection. paint.net should provide a method to override.

In the moment the compiler guesses that this method is just a private one in your code and nobody calls it. And if owner is not used in the implementation of the method the compiler proposes to remove it. But that's not a good idea because the reflection code will try to set this parameter and fail.

 

So to get rid of the warning you should use the owner parameter.

Typically OnWindowHelpButtonClicked shows a dialog or a message box. The Show method of these objects allows to provide an owner as first parameter. I.e.

    MessageBox.Show(owner, ...

This is a good idea because setting this parameter add the dialog to the dialog stack of the application.

 

If the code doesn't use a dialog then try to assign the parameter to itself:

    owner = owner;

(but this may generate an other warning).

 

 

 

 

  • Thanks 1

midoras signature.gif

Link to comment
Share on other sites

I have just installed the latest paint.net (4.3.3) in 'tandem' with v4.2.16 and v3.5.11 (perhaps that's a tricycle 😄). I decided to name the program folders 'pdn4.3.3', 'pdn4.2.16' and 'pdn3.5.11'.
Unfortunately this prevents the codelab v6.4 installer from detecting the installation.... I've just tried renaming the pdn4.3.3 folder back to 'paint.net' - the installer still tells me I have version 0.0 and asks if I want to proceed anyway. I aborted the installer.

 

Is it possible to get the codelab v6.4 .dll without an installer?... or does the 'install anyway' choice allow me to specify a path?

 

Many thanks

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

  • Rick Brewster changed the title to CodeLab v6.4 (for advanced users) Released November 20, 2021
On 11/25/2021 at 11:40 PM, Red ochre said:

I have just installed the latest paint.net (4.3.3) in 'tandem' with v4.2.16 and v3.5.11 (perhaps that's a tricycle 😄). I decided to name the program folders 'pdn4.3.3', 'pdn4.2.16' and 'pdn3.5.11'.
Unfortunately this prevents the codelab v6.4 installer from detecting the installation.... I've just tried renaming the pdn4.3.3 folder back to 'paint.net' - the installer still tells me I have version 0.0 and asks if I want to proceed anyway. I aborted the installer.

 

Is it possible to get the codelab v6.4 .dll without an installer?... or does the 'install anyway' choice allow me to specify a path?

 

Many thanks

Bump... Is there any way to safely extract the .dll from the installer or could someone share it, please?

Would changing the program folder name have messed up a setting in the registry?

 

@AndrewDavid Needing to install VS2022 and work out how to compile from Github seems like overkill! - but thanks anyway.

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

22 minutes ago, Red ochre said:

Bump... Is there any way to safely extract the .dll from the installer or could someone share it, please?

Would changing the program folder name have messed up a setting in the registry?

 

@AndrewDavid Needing to install VS2022 and work out how to compile from Github seems like overkill! - but thanks anyway.

 

The installer reads installation path from registry but it can't find it. You should only specify installation path during PDN installation and not change it afterwards. It'll break all plugin installers that tries to detect version/location and it can also mess up your PDN file associations. You can use portable versions.

 

For extracting Codelab.dll,

You can use ILSpy to extract the resource. https://github.com/icsharpcode/ILSpy

 

The resource name you'd want to extract is Install.Attachments.Codelab.dll

 

image.png.2ff44d256c5bc6732d54a0085c4e1a76.png

 

 

  • Upvote 1
Link to comment
Share on other sites

2 hours ago, otuncelli said:

The installer reads installation path from registry but it can't find it. You should only specify installation path during PDN installation and not change it afterwards. It'll break all plugin installers that tries to detect version/location and it can also mess up your PDN file associations.

So I've discovered. 🙄

 

Thanks for the other advice. I've never used ILspy - I should, when I get the time.

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

  • 1 month later...

@AndrewDavid This issue doesn't seem to be related to CodeLab or maybe I'm missing something?

 

In explorer, right click column header and select "Date modified". This setting is for per folder. If you want it to be default for all folders, click "View menu"->"Options"->"View tab"->"Apply to all Folders"

 

See here for detailed explanation:

https://www.guidingtech.com/add-columns-folders-windows-10-file-explorer/

Edited by otuncelli
  • Thanks 1
Link to comment
Share on other sites

Taken from @BoltBait's examples;

 

image.png.223ff637930d188704fbf57289c6153a.png

I am trying to get "Arial" as the default selection. Yes I have Arial installed. Adamas is the first font I have installed. I have tried running Lesson 4 from Codelab, but the results are the same. I suspect the code to change the default Font selection has changed.

qG3vze.png

 

Link to comment
Share on other sites

2 hours ago, AndrewDavid said:

I am trying to get "Arial" as the default selection. Yes I have Arial installed. Adamas is the first font I have installed. I have tried running Lesson 4 from Codelab, but the results are the same. I suspect the code to change the default Font selection has changed.

 

That has never worked in CodeLab. You'll have to take the code generated by CodeLab, and manually edit it.

We should probably fix that though.

  • Thanks 1
Link to comment
Share on other sites

3 hours ago, toe_head2001 said:

 

That has never worked in CodeLab. You'll have to take the code generated by CodeLab, and manually edit it.

We should probably fix that though.

 

I tried to fix this on my fork here:

https://github.com/otuncelli/CodeLab

 

Changes:

https://github.com/BoltBait/CodeLab/compare/master...otuncelli:master

 

I can create a PR if all seems OK and you're not planning to do something else?

Edited by otuncelli
Link to comment
Share on other sites

2 hours ago, otuncelli said:

 

I tried to fix this on my fork here:

https://github.com/otuncelli/CodeLab

 

Changes:

https://github.com/BoltBait/CodeLab/compare/master...otuncelli:master

 

I can create a PR if all seems OK and you're not planning to do something else?

 

You haven't done anything to the UI Builder screen.

 

Check to see how the Color Wheel control looks/works as far as a default value is handled.  Also, how a default of "None" is handled.

 

I'd say, you're about 50% there.

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

4 hours ago, BoltBait said:

 

You haven't done anything to the UI Builder screen.

 

Check to see how the Color Wheel control looks/works as far as a default value is handled.  Also, how a default of "None" is handled.

 

I'd say, you're about 50% there.

 

Yes, this is a partial fix. My intention was to fix the issue @AndrewDavid reported without breaking anything else. UI Designer seems to require more work that I can not afford currently.

Edited by otuncelli
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.

 Share

×
×
  • Create New...