Ego Eram Reputo Posted May 11, 2020 Share Posted May 11, 2020 Alrighty! RE: https://forums.getpaint.net/topic/116364-math-support-latex/ Here's the second draft: <removed> Installation: Unzip the file Copy both DLL files to.... Classic: your \Effects\ folder. Store: /My Documents/ paint.net App Files/Effects/ 3. Restart paint.net 4. find the plugin in Effects > Text Formations Notes: I tried and failed to bundle the two DLL's into one Renders in Black - not the Primary color. Remainder of the layer will be made transparent 1 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...
toe_head2001 Posted May 11, 2020 Share Posted May 11, 2020 1) Needs some Dark Theme lovin' https://forums.getpaint.net/topic/112962-guide-dark-theme-support-for-custom-effectconfigdialog/ 2) The 'X' needs to capitalized. LaTeX 3) You're still generating the image in the UI class. It's usually better to do that kind of thing in OnSetRenderInfo() 1 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted May 11, 2020 Author Share Posted May 11, 2020 Thanks for the pointers toe_head2001. I'll give it some more lovin' 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...
null54 Posted May 13, 2020 Share Posted May 13, 2020 On 5/10/2020 at 9:38 PM, Ego Eram Reputo said: I tried and failed to bundle the two DLL's into one I ran into this when building my GmicSharpPdn example plugin. I ended up using the ILMerge.Fody NuGet package with a customized included files filter, see the Build notes section of the gmic-sharp-pdn-example Readme for details. Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted May 13, 2020 Author Share Posted May 13, 2020 Thanks Null54. I'll try that. I should have been more verbose when I mentioned that issue. I did manage to get the DLLs combined, unfortunately the plugin did not run in that state. The error was along the lines of "your plugin can't find WpfMath.dll or one of its components". 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...
Ego Eram Reputo Posted May 24, 2020 Author Share Posted May 24, 2020 I haven't succeeded in bundling the DLLs. I'm inclinded think the WpfMath.dll may not be playing nicely with ILMerge. On 5/11/2020 at 6:18 PM, toe_head2001 said: 1) Needs some Dark Theme lovin' Oh yeah.... On 5/11/2020 at 6:18 PM, toe_head2001 said: 2) The 'X' needs to capitalized. LaTeX Check. On 5/11/2020 at 6:18 PM, toe_head2001 said: 3) You're still generating the image in the UI class. It's usually better to do that kind of thing in OnSetRenderInfo() Sorted. Here's the third draft <removed> Installation: Unzip the file Copy both DLL files to.... Classic: your \Effects\ folder. Store: /My Documents/ paint.net App Files/Effects/ 3. Restart paint.net 4. find the plugin in Effects > Text Formations 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...
null54 Posted May 24, 2020 Share Posted May 24, 2020 1 hour ago, Ego Eram Reputo said: I'm inclinded think the WpfMath.dll may not be playing nicely with ILMerge. After looking at the ILMerge manual, my guess is that WpfMath uses embedded resources that it fails to find after merging. You will probably just have to distribute the two DLL files. 1 Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
toe_head2001 Posted May 24, 2020 Share Posted May 24, 2020 Looks pretty good now, but I have a few suggestions: - Set the maximum height of the dialog to a much lower value. - The plugin output should either: make the entire canvas transparent, or the equation should be blended onto the source Surface. - For the "More plugins" link, you should use the IShellService.LaunchUrl() method since it does error/exception handling for you. And don't forget the 's' in https:// Services.GetService<IShellService>().LaunchUrl(null, "https://www.getpaint.net/redirect/plugins.html"); - Don't forget to set the Cancel property in CancelEventArgs: private void MathLaTexConfigDialog_HelpButtonClicked(object sender, CancelEventArgs e) { e.Cancel = true; MessageBox.Show("Bla Bla Bla"); } - Each time you set a new value for your Bitmap, be sure to dispose the old value. Garbage Collection in .NET is pretty good these days, but exercising "best practices" is still better. myBitmap?.Dispose(); myBitmap = new Bitamp(newValue) 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
toe_head2001 Posted May 24, 2020 Share Posted May 24, 2020 Actually, for the HelpButton, you should just use the override, instead of assigning a method to the event. protected override void OnHelpButtonClicked(CancelEventArgs e) { e.Cancel = true; base.OnHelpButtonClicked(e); Services.GetService<IShellService>().LaunchUrl(null, "https://www.getpaint.net/redirect/plugins.html"); } And do the same for any other Events on the Form. 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Pixey Posted May 24, 2020 Share Posted May 24, 2020 Looking like @Ego Eram Reputo is an Einstein 😱 Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
NSD Posted May 24, 2020 Share Posted May 24, 2020 @Ego Eram Reputo You should also fix the issue with scaling size. 1 Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted May 27, 2020 Author Share Posted May 27, 2020 On 5/24/2020 at 9:15 PM, toe_head2001 said: - Set the maximum height of the dialog to a much lower value. Done. I'll fix the height. On 5/24/2020 at 9:15 PM, toe_head2001 said: - The plugin output should either: make the entire canvas transparent, or the equation should be blended onto the source Surface. I've gone with clearing the canvas. On 5/24/2020 at 9:15 PM, toe_head2001 said: - For the "More plugins" link, you should use the IShellService.LaunchUrl() method Changed. On 5/24/2020 at 9:15 PM, toe_head2001 said: - Don't forget to set the Cancel property in CancelEventArgs: Added. On 5/24/2020 at 9:15 PM, toe_head2001 said: Each time you set a new value for your Bitmap, be sure to dispose the old value. Quite right. Added. On 5/24/2020 at 9:40 PM, toe_head2001 said: Actually, for the HelpButton, you should just use the override, instead of assigning a method to the event. That's neat. Changed. On 5/25/2020 at 4:56 AM, NSD said: You should also fix the issue with scaling size. I'm working through the HiDPI issues (there are a few....) 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...
Ego Eram Reputo Posted June 24, 2020 Author Share Posted June 24, 2020 Alrighty. This build should have fixed the high DPI issues and I've added some theme-love to make the error messages more readable too. I tested it at 100%, 125%, 150% & 175% font size. If anyone wants to go higher - please let me know if it continues to scale well. Download Installation: Unzip the file Copy both DLL files to.... Classic: your \Effects\ folder. Store: /My Documents/ paint.net App Files/Effects/ 3. Restart paint.net 4. find the plugin in Effects > Text Formations 1 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...
NSD Posted June 24, 2020 Share Posted June 24, 2020 Very nice job! Thanks. 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.