toe_head2001 Posted August 28, 2021 Share Posted August 28, 2021 2 minutes ago, AndrewDavid said: Buried in Unfinished plugins Can you provide a link, so I don't have to dig it up? Just now, AndrewDavid said: ILSpy.exe That explains some of your issues. You should use dotPeek instead. https://www.jetbrains.com/decompiler/ Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
AndrewDavid Posted August 28, 2021 Author Share Posted August 28, 2021 https://forums.getpaint.net/topic/111330-unfinished-plugins/page/6/ After building JustifyText I see no problem using ILSpy.exe. I didn't need any assistance for that one. (After finding a message you wrote along time ago). At least that's one app I understand. I'll try your suggestion and see if its any better. I think these plugins were built in codelab. Decompiling them for Visual Studio is the challenge. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted August 28, 2021 Share Posted August 28, 2021 Oh, this is an OptionBasedLibrary plugin; of course you're not going to find the source that's doing the XML Serializing within the plugin itself. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
toe_head2001 Posted August 28, 2021 Share Posted August 28, 2021 1 hour ago, AndrewDavid said: I think these plugins were built in codelab. Decompiling them for Visual Studio is the challenge. Sorry, but this makes no sense. CodeLab and Visual Studio compile code the same way. Fun fact though, neither of these two plugins were made using CodeLab. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 28, 2021 Share Posted August 28, 2021 14 hours ago, AndrewDavid said: @Rick Brewster @toe_head2001 JusttifyText.DLL Uploaded another broken plugin to GitHub for determining what is causing the failure of the plugin's menu attempt to save/load files. Definitely need help for this one. I can't even find the source code for that functionality. I have been able to create the DLL correctly, I have updated it to run on net5.0-windows and hope you can resolve this loss of functionality. There are about six more plugins that fail in the same manner, so I hope when we determine the correct code for this one, it can be applied to the others. This is the error That's the same error I got while trying to patch up some of the remaining plugins you mentioned in the "Plugins that fail in 4.3" topic. I'm not sure how to fix this, nor how it worked in the first place. Something in XmlSerializer (part of the framework) may have changed? Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
AndrewDavid Posted August 28, 2021 Author Share Posted August 28, 2021 CircularText.DLL Uploaded another broken plugin to GitHub. This is one that would not load in the new beta version. It loads fine now but still has the menu problem. Different error as well. It will load but not save. 7 hours ago, Rick Brewster said: Something in XmlSerializer (part of the framework) may have changed? That ball is in your court. The headache of updating software. The plugin still works, just lost some of its functionality. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 29, 2021 Share Posted August 29, 2021 Like I said in the thread for the previous alpha build, I'm not sure there's anything I can do. The plugin(s) will just be at reduced functionality until updates to them are released. @midora is the author of OptionBasedLibrary, he'll need to look into it. If there's something that can be changed in the plugin to make this work, I can probably make a shim for it so that no updates are needed, but I am deferring/delegating to y'all to figure out what changes are needed here. 1 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
AndrewDavid Posted August 29, 2021 Author Share Posted August 29, 2021 @Rick Brewster I would like to go back to the list of broken plugins and remove all the lines over plugins that are still not operating at 100%. When and if you release the next update, users will need to know what no longer works. I can think of 3 categories. 1. Broken - Will not load/crashes Paint.Net. 2. Fixed - Will run but at reduced capability/new version may or may not needs to be downloaded. (Like CircularText) 3. Fixed to full functionality/Download required. (Like Plugin Browser). Red/Yellow\Green markers. Maybe the text if the software will allow, Thoughts? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 29, 2021 Share Posted August 29, 2021 Sounds good to me Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
midora Posted August 29, 2021 Share Posted August 29, 2021 Regarding OptionBasedLibrary. OBL was still under development when I had to interrupt my support. Some people still continued to use it in their plugins. I guess it makes no sense to get all the old variants of OBL to run. IMHO this is a waste of time. I'm concentrating on the work to finalize a single OBL and get my own plugins to run. In a next step other plugins could be updated (or die 😉 By the way would it be possible to increase the width of the settings panel a bit in the save dialog? It's really ultra small if a vertical slider is needed. Or even better would be a splitter between settings and preview. 🙂 1 Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 3, 2021 Author Share Posted September 3, 2021 Here I have problem with a simple solution you can find I'm sure. I decompiled a small outdated plugin AdvGrey.dll to try and build it in VS2022 Preview Net 5.0 from the beginning. One error has stumped me in the code. Spoiler using System.Drawing; using System.Reflection; namespace PaintDotNet.Effects { [EffectCategory(EffectCategory.Effect)] public class UserScript : Effect { private int Amount1 = 100; private int Amount2 = 100; private int Amount3 = 100; private EffectConfigDialog threeAmountsConfigDialog; private object selection; public string Amount1Label { get; private set; } public string Amount2Label { get; private set; } public string Amount3Label { get; private set; } public string Amount4Label { get; private set; } public int Amount1Minimum { get; private set; } public int Amount1Maximum { get; private set; } public int Amount1Default { get; private set; } public int Amount2Minimum { get; private set; } public int Amount2Maximum { get; private set; } public int Amount2Default { get; private set; } public int Amount3Minimum { get; private set; } public int Amount3Maximum { get; private set; } public int Amount3Default { get; private set; } public override void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, int startIndex, int length) { for (int i = startIndex; i < startIndex + length; i++) { } } [System.Obsolete] public UserScript() #pragma warning disable CA1416 // Validate platform compatibility : base("Advanced Greyscale", new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("ico.png")), isConfigurable: true) #pragma warning restore CA1416 // Validate platform compatibility { } public override EffectConfigDialog CreateConfigDialog() { { Amount1Label = "Red"; Amount1Minimum = 0; Amount1Maximum = 100; Amount1Default = 100; Amount2Label = "Green"; Amount2Minimum = 0; Amount2Maximum = 100; Amount2Default = 100; Amount3Label = "Blue"; Amount3Minimum = 0; Amount3Maximum = 100; Amount3Default = 100; Amount4Label = "Advanced Greyscale"; }; return threeAmountsConfigDialog; } private void Render(Surface dst, Surface src, Rectangle rect) { Rectangle boundsInt = EnvironmentParameters.GetSelectionAsPdnRegion().GetBoundsInt(); for (int i = rect.Top; i < rect.Bottom; i++) { for (int j = rect.Left; j < rect.Right; j++) { if (boundsInt.IsVisible(j, i)) { ColorBgra colorBgra = src[j, i]; byte r = colorBgra.R; byte g = colorBgra.G; byte b = colorBgra.B; byte a = colorBgra.A; float num = (float)Amount1 / 100f; float num2 = (float)Amount2 / 100f; float num3 = (float)Amount3 / 100f; num *= (float)(int)r; num2 *= (float)(int)g; num3 *= (float)(int)b; float num4 = Amount1 + Amount2 + Amount3; num4 /= 300f; float num5 = (int)(byte)((num + num2 + num3) / 3f); num5 /= num4; byte b2 = (byte)num5; colorBgra = (dst[j, i] = ColorBgra.FromBgra(b2, b2, b2, a)); } } } } } } The only error I get is for the underlined IsVisible extension method found at line 67 Its such a small plugin, I don't know how it could stump me. The code is contained in the old DLL and works fine in Paint.net. Upgrading it to Net 5.0 showed what has been depreciated and I was able to fix all errors except this one. Could you please help? Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted September 3, 2021 Share Posted September 3, 2021 Calling IsVisible() is not necessary. Just delete that if statement. 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 21, 2021 Author Share Posted September 21, 2021 To whom it may concern I've come a long way since my last post. Found some guides buried in the forum. Visual Studio 3033 has had some issues I would think Net 5.0 has some too. Still missing documentation for many issues. I think I have a good working template now. Now when I try to create a Git repository, I have to do it through the command line. It was uploading fine a few weeks ago. I also don't get the blue icons anymore for my newer repositories. The resource files are not segregated into their own folders. https://github.com/AndrewDavid007/DrawGrid2021 I have built this one totally on Net 5.0 However it is not rendering the grid to the surface. I'm sure you will find the code messy - but it does work with that exception. If you have the time and patience have a look and see what is wrong. You are free to update as necessary on Git Thank you in advance. I know you guys like puzzles 😊 Quote Link to comment Share on other sites More sharing options...
midora Posted September 21, 2021 Share Posted September 21, 2021 Your override of the Render method doesn't render anything. To create a virtual OnRender method makes only sense if you like to override it (and the loop there executes an empty statement). So add the loop with a call to the second Render method to the first one. Take the surfaces from the RenderArgs. I'm not adding a code snippet now. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 21, 2021 Author Share Posted September 21, 2021 @midora Thanks for the feedback. I constantly ran into errors trying to do that. Anything I change results in error(s). I can wait for your code snippet Quote Link to comment Share on other sites More sharing options...
midora Posted September 22, 2021 Share Posted September 22, 2021 Untested, just looking in the repo. Add to the override Render method // Get the current settings from the token (or do it in OnSetRenderInfo) Amount1 = Amount2 = // Render each rectangle for (int index = startIndex; index < startIndex + length; ++index) Render(dstArgs.Surface, srcArgs.Surface, rois[index]); But you should really start with a more simple project. There is too much overhead in this one. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 22, 2021 Author Share Posted September 22, 2021 @midora And here I thought that was a simple one. I just go by the size of the DLL. Remember the original crashed trying to divide by 0? Well I tried your suggestions but I couldn't find a place to put your Amount statements without causing an error. I placed your other snippet where I think it should go, but that caused a crash. Crashed trying to divide by 0. Perhaps I didn't put it in the right place. All the code was copied from the original and placed in my Net 5.0 template. Some things I understand but the actual coding is beyond my ability to fathom at this time. I'm hoping to gather experience doing thesr small plugins. I was able to rebuild @xod,s text plugins. But they were working to begin with. Hope you will try again and test. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted September 23, 2021 Author Share Posted September 23, 2021 I was able to resolve this one (DrawGrid) easily with the new Codelab. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted November 20, 2021 Author Share Posted November 20, 2021 @Rick Brewster @toe_head2001 This may sound ridiculous, but I am unable to create a form based project in Visual Studio 2022. When I create the project, without adding references to Paint.Net I can build the form. When I add Paint.Net references I receive the failed to launch error. I've tried adding the references first, but that is of no help. I've made a Git repository of a working form without references to Paint.Net assemblies. See for yourself when Paint.Net references are added, You can no longer view the form. https://github.com/AndrewDavid007/ZoomBlurDeluxe Now that I made a post, it works. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted April 28, 2022 Author Share Posted April 28, 2022 On 11/20/2021 at 5:41 AM, AndrewDavid said: This may sound ridiculous, but I am unable to create a form based project in Visual Studio 2022. With all the recent updates to VS2022, I can now successfully build this old plugin on Net 6.0. For personal use only Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted April 29, 2022 Share Posted April 29, 2022 On 11/21/2021 at 2:41 AM, AndrewDavid said: This may sound ridiculous, but I am unable to create a form based project in Visual Studio 2022 How did you resolve the failure of the Form Designer? Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
AndrewDavid Posted April 29, 2022 Author Share Posted April 29, 2022 I used Paint.net 4.3.10. VS2022 17.2.0 preview 5.0 is my current version. There was 2 updates last week. the first update 17.2.0 Preview 4.0 I believe resolved the issue. Rather than building it from scratch, I used a template from a project that was working for me when I started learning VS. I used it to build ColorCount (a smaller form based plugin). I then created another template from the working ColorCount to build ZoomBlurDeluxe. What was interesting was the size of these 2 templates. The first one was 19MB. When I loaded it, I found a lot of unnecessary files like all the dlls from Paint.net. I removed them and when I built the next template, it turned out just a 55kb file size. Maybe it was practice and determination. I have been called a bulldog before. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.