Red ochre Posted August 20, 2020 Posted August 20, 2020 Sorry - I don't understand (my fault) but thanks for replying. I'll try another approach. Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings
Modus Ponens Posted August 20, 2020 Posted August 20, 2020 (edited) When I use the "Effect" template, and I try to edit the ConfigDialog in the Windows Forms Designer, the designer behaves very upsettingly. I'm running Windows 10 and I'm using Visual Studio 2019. Specifically, when I try to drag the resizing handles for the window, besides just resizing, the window jumps to God only knows where. In this screenshot, I began clicking and holding the button: and the moment I dragged it a pixel to the right, the dialog widget jumped out of view, and I became unable to scroll the editor window far enough in any direction to see any of it. Then I tried closing and reopening the file, and now all I see is this where the dialog used to be: ...and so on. In fact, changing many of the properties, through the GUI or through the editor panel in the corner of VS, causes similar distressing behavior. What I've shown you here is actually a lot worse than it was when I first noticed that there were problems: originally, resizing the dialog would only cause it to move rapidly down and to the right, but not so rapidly as to be gone in a single update like it is now. At first I thought this was the fault of the Forms Designer itself, but I don't think so anymore. I started following this official tutorial to see if these problems would occur with a simpler project. When I made a new project using the built-in Windows Forms Control Library template as the tutorial told me, I encountered no such issues. Is there a problem with something in the project files? What gives? Edited August 20, 2020 by Modus Ponens Quote
toe_head2001 Posted August 20, 2020 Author Posted August 20, 2020 20 minutes ago, Modus Ponens said: At first I thought this was the fault of the Forms Designer itself, but I don't think so anymore. I started following this official tutorial to see if these problems would occur with a simpler project. When I made a new project using the built-in Windows Forms Control Library template as the tutorial told me, I encountered no such issues. Is there a problem with something in the project files? What gives? You could have saved yourself a whole lot of time, if you had just read the previous posts in this topic. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
Modus Ponens Posted August 20, 2020 Posted August 20, 2020 Oh, whoops. I skimmed the thread, but I guess I skimmed it too quickly. Quote
toe_head2001 Posted August 25, 2020 Author Posted August 25, 2020 On 12/23/2019 at 5:51 PM, NSD said: I was curious to see if the issue by resizing the Form was fixed On 8/20/2020 at 4:06 AM, Modus Ponens said: and the moment I dragged it a pixel to the right, the dialog widget jumped out of view This will be fixed in paint.net v4.2.14. You can install an alpha build from here: https://forums.getpaint.net/topic/116972-paintnet-4214-alpha-build-7542/ 1 4 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
Tim! Posted September 13, 2020 Posted September 13, 2020 Great to see that the file types have been updated. I've just been trying to compile the code with VS2017 targetting .NET 4.8. I have a couple of issues with SvgFileType.cs. Firstly, the obsolete constructor. Have I fixed it correctly? public class SvgFileType : FileType { // // Obsolete. // //public SvgFileType() // : base( // "Scalable Vector Graphics", // name // FileTypeFlags.SupportsLoading, // flags // new[] {".svg", ".svgz"}) // extensions //{ //} // // New and improved. // public SvgFileType() : base ( "Scalable Vector Graphics", // name new FileTypeOptions // options { LoadExtensions = new string[] { ".svg", ".svgx" } } ) { //this.Options.LoadExtensions = new List<string> { ".svg", ".svgx" }; //this.Options.LoadExtensions = new string[] { ".svg", ".svgx" }; //FileTypeOptions fto = new FileTypeOptions //{ // LoadExtensions = new List<string> { ".svg", ".svgx" } //}; } Secondly, I get 4 compile errors with SvgVisualElement.Visible being read only, e.g.: Quote Error CS0200 Property or indexer 'SvgVisualElement.Visible' cannot be assigned to -- it is read only SvgFileTypePlugin C:\Users\me\Dowloads\Scalable-Vector-Graphics-Plugin-for-Paint.NET-0.3-alpha\Scalable-Vector-Graphics-Plugin-for-Paint.NET-0.3-alpha\SvgFileType\SvgFileType.cs Would it be OK to comment these out. or is there a new equivalent? Quote
toe_head2001 Posted September 13, 2020 Author Posted September 13, 2020 3 hours ago, Tim! said: Firstly, the obsolete constructor. Have I fixed it correctly? That looks okay to me. 3 hours ago, Tim! said: Secondly, I get 4 compile errors with SvgVisualElement.Visible being read only, e.g.: Would it be OK to comment these out. or is there a new equivalent? You have to ask the people developing the SVG plugin. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
Tim! Posted September 14, 2020 Posted September 14, 2020 Thanks. I commented-out the 4 errors and compiled it, and then tried it out with Paint.NET v4.2.13. There don't seem to be any obvious (at least to me) issues so far. Quote
NSD Posted October 10, 2020 Posted October 10, 2020 I just want to mention that in Project Template - Effect the slider has a minimum value equal to 0 which leads to crash due to division by zero in the following line: CurrentPixel = (y% amount1 == 0)? ... Also, SubmenuName is Blur although I think it should be null to be easily found by the user. The plugin below was created just to test some things. It doesn't do anything special, it just draws lines and a circle. The color control is based on the control in the CodeLab source code and is quite similar. Here is the source code:http://www.mediafire.com/file/9f9gz612mmmlldu/VSpdnProject.zip/file 1 Quote
toe_head2001 Posted October 10, 2020 Author Posted October 10, 2020 1 hour ago, NSD said: I just want to mention that in Project Template - Effect the slider has a minimum value equal to 0 which leads to crash due to division by zero in the following line: CurrentPixel = (y% amount1 == 0)? ... Also, SubmenuName is Blur although I think it should be null to be easily found by the user. People aren't meant to run the example code, but if it bothers you, submit a Pull request on the Github project. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
NSD Posted October 10, 2020 Posted October 10, 2020 No, it don't bothers me, you did a great job with this Template. Thank you. Quote
xchellx Posted August 1, 2021 Posted August 1, 2021 (edited) Unfortunately, these templates use the .NET Framework. The newest Paint.NET alpha (which I wish to target with my plugin, for reasons of having the newest C# 9 features) uses .NET 5. If I do what these templates do (which is target the Paint.NET DLLs, copy plugin dll to FileTypes/Effects folder at post build, then start Paint.NET as the debug action) with the new SDK csproj format as well as targeting `net5.0-windows`, it'll complain of DLL conflicts due to different versions that the plugin is using compared to Paint.NET. Do you plan on fixing these templates for .NET 5? EDIT: After some messing around, I did get it to compile. Although, it would be nice to have these templates updated... New csproj format properties: Spoiler <PropertyGroup> <OutputType>Library</OutputType> <TargetFramework>net5.0-windows</TargetFramework> <UseWindowsForms>true</UseWindowsForms> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> </PropertyGroup> Paint.NET DLL references: Spoiler <ItemGroup> <Reference Include="PaintDotNet.Base"> <HintPath>C:\Program Files\paint.net\PaintDotNet.Base.dll</HintPath> </Reference> <Reference Include="PaintDotNet.Core"> <HintPath>C:\Program Files\paint.net\PaintDotNet.Core.dll</HintPath> </Reference> <Reference Include="PaintDotNet.Data"> <HintPath>C:\Program Files\paint.net\PaintDotNet.Data.dll</HintPath> </Reference> </ItemGroup> PostBuild event (new csproj format): Spoiler <Target Name="PostBuild" AfterTargets="PostBuildEvent"> <Exec Command="if exist "$(TargetPath)" (
 copy "$(TargetPath)" "C:\Program Files\paint.net\FileTypes\"
) else (
 echo ERROR: Failed to copy plugin! Check if the build failed.
 exit(1)
)" /> </Target> Then add this to the end of your AssemblyInfo.cs: Spoiler [assembly: SupportedOSPlatform("windows")] And finally, debugging paint.net at start debug: Spoiler Edited August 2, 2021 by xchellx Figured out how to build plugin with .NET 5; explanation Quote
toe_head2001 Posted August 2, 2021 Author Posted August 2, 2021 3 hours ago, xchellx said: After some messing around, I did get it to compile. Although, it would be nice to have these templates updated... Okay, if you've already made the effort to get it working, then go submit a pull request on Github. Keep in mind I won't publish an update until Paint.NET v4.3 is released. Existing plugin codebases can just use the try-convert tool to automatically migrate solutions/projects to .NET 5. https://github.com/dotnet/try-convert 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
AndrewDavid Posted August 5, 2021 Posted August 5, 2021 @toe_head2001, @Rick Brewster, @BoltBait, @Ego Eram Reputo This may mean nothing to you But it represents a milestone for me 2 1 Quote
AndrewDavid Posted September 1, 2021 Posted September 1, 2021 Configuration Manager in Visual Studio 2019? I attempted to make the changes in the previous post to update the template for Core 5.0. No easy task. I tried editing the code with Visual Studio Code but when I opened the Project in Visual Studio it prompted me to open the Configuration Manager. Microsoft Docs describes how to activate Configuration Manager but my installation is missing the described menu entry. "Show advanced build configurations" does not exist. I did try another approach by building the template from a new project, but when copying the code into the new project, there were too many errors generated (not because of lack of references). Seems Core 5.0 is a whole new language. Quote
toe_head2001 Posted September 1, 2021 Author Posted September 1, 2021 @AndrewDavid sounds like you keep biting off more than you can chew. If you're trying to compile the template files, that will never work. The templates have a bunch of none-code within them. What you want to build is the VSIX package. Hint: You need the 'Visual Studio SDK' installed. You can find an option for it in the Visual Studio Installer. I have no idea what you're talking about with the Configuration Manager. Sounds like Visual Studio is just confused, because you're missing that SDK. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
AndrewDavid Posted September 1, 2021 Posted September 1, 2021 It does say create addons and extensions (which I have no plans on doing) which is why it wasn't installed. Once installed, still no config manager. I'll just continue downloading until I get it. 40 minutes ago, toe_head2001 said: sounds like you keep biting off more than you can chew. I have time to learn. 41 minutes ago, toe_head2001 said: I have no idea what you're talking about with the Configuration Manager. Do you see it? I may have to build it as a custom tool. Quote
AlchemistAdam Posted August 11, 2022 Posted August 11, 2022 @toe_head2001 I'm unable to install the extension. I'm using VS 2022 17.2.6 and have .NET Framework 4.7.2 SDK installed. Any idea if the extension needs to be updated or any components I might be missing? I was unable to find any components related to Microsoft.VisualStudio.Component.CoreEditor, so I'm assuming it's installed by default. 11-08-2022 14:46:50 - Microsoft VSIX Installer 11-08-2022 14:46:50 - ------------------------------------------- 11-08-2022 14:46:50 - vsixinstaller.exe version: 11-08-2022 14:46:50 - 17.4.23-preview1 11-08-2022 14:46:50 - ------------------------------------------- 11-08-2022 14:46:50 - Command line parameters: 11-08-2022 14:46:50 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\\Downloads\PaintDotNETPluginTemplates.vsix 11-08-2022 14:46:50 - ------------------------------------------- 11-08-2022 14:46:50 - Microsoft VSIX Installer 11-08-2022 14:46:50 - ------------------------------------------- 11-08-2022 14:46:51 - Initializing Install... 11-08-2022 14:46:51 - Extension Details... 11-08-2022 14:46:51 - Identifier : PaintDotNETPluginTemplates.b60ff1b7-9432-4d62-b199-6bf5e2914636 11-08-2022 14:46:51 - Name : Paint.NET Plugin Templates 11-08-2022 14:46:51 - Author : toe_head2001 11-08-2022 14:46:51 - Version : 0.0.6 11-08-2022 14:46:51 - Description : Project Templates for creating Paint.NET plugins. 11-08-2022 14:46:51 - Locale : en-US 11-08-2022 14:46:51 - MoreInfoURL : https://forums.getpaint.net/topic/115325-project-templates-for-visual-studio/ 11-08-2022 14:46:51 - InstalledByMSI : False 11-08-2022 14:46:51 - SupportedFrameworkVersionRange : [4.5,) 11-08-2022 14:46:51 - 11-08-2022 14:46:51 - SignatureState : Unsigned 11-08-2022 14:46:51 - Supported Products : 11-08-2022 14:46:51 - Microsoft.VisualStudio.Community 11-08-2022 14:46:51 - Version : [15.0,17.0) 11-08-2022 14:46:51 - ProductArchitecture : x86 11-08-2022 14:46:51 - 11-08-2022 14:46:51 - References : 11-08-2022 14:46:51 - Prerequisites : 11-08-2022 14:46:51 - ------------------------------------------------------- 11-08-2022 14:46:51 - Identifier : Microsoft.VisualStudio.Component.CoreEditor 11-08-2022 14:46:51 - Name : Visual Studio core editor 11-08-2022 14:46:51 - Version : [15.0,17.0) 11-08-2022 14:46:51 - 11-08-2022 14:46:51 - ------------------------------------------------------- 11-08-2022 14:46:51 - Identifier : Microsoft.Net.Component.4.7.2.SDK 11-08-2022 14:46:51 - Name : .NET Framework 4.7.2 SDK 11-08-2022 14:46:51 - Version : [15.0,17.0) 11-08-2022 14:46:51 - 11-08-2022 14:46:51 - Signature Details... 11-08-2022 14:46:51 - Extension is not signed. 11-08-2022 14:46:51 - 11-08-2022 14:46:51 - Searching for applicable products... 11-08-2022 14:46:51 - Found installed product - Global Location 11-08-2022 14:46:51 - Found installed product - Visual Studio Community 2022 11-08-2022 14:46:51 - Found installed product - Visual Studio Community 2022 Preview 11-08-2022 14:46:51 - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products. ved VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData) ved VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData) ved VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported) ved VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported) ved VSIXInstaller.App.Initialize(Boolean isRepairSupported) ved VSIXInstaller.App.Initialize() ved System.Threading.Tasks.Task`1.InnerInvoke() ved System.Threading.Tasks.Task.Execute() Quote
toe_head2001 Posted August 11, 2022 Author Posted August 11, 2022 The templates were made for an older version of Paint.NET during the Visual Studio 2019 timeframe. I would not expect them to work for current versions. Are you sure you need these templates? Plugins can be created in CodeLab most of the time. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
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.