Modus Ponens Posted August 19, 2020 Share Posted August 19, 2020 I'm trying to write a plugin that analyzes the pixels and extracts some data from them, and then reports that data somehow. For the sake of discussion, let's just say that I want to calculate the average color of all the pixels and then show the name of that color in English. (This isn't actually what I want my plugin to do, but it's easier to explain.) Ideally, when you select the plugin from the Effects menu, the effect dialog would open and it would have a "Run" button or something. Clicking that button would run the analysis and output the color name into a text field in the effect dialog. I know neither how to make the button nor how to update the text shown in a text field in the effect dialog. Are these things that can be done with a CodeLab plugin? Here's a mock-up of what I'm talking about. Note that there's no "OK" button, since this plugin doesn't actually do anything to any pixels in the image; I definitely don't mind having an OK button in addition to the Run button, if I can't get rid of it, but it's not necessary for what I'm trying to do. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted August 19, 2020 Share Posted August 19, 2020 3 minutes ago, Modus Ponens said: Are these things that can be done with a CodeLab plugin? No. You'll need to make a custom WinForms dialog if you want to do that kind of stuff. Luckily, there are templates available: https://forums.getpaint.net/topic/115325-project-templates-for-visual-studio/ 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Modus Ponens Posted August 19, 2020 Author Share Posted August 19, 2020 Excellent, thanks so much. In the post you linked me to, you listed six plugin types. Based on what I have described, can you recommend which of these I should use? I don't really know what all of them are, but I kind of have the vague intuition that I'm making a "PropertyBasedEffect" (the plugin I actually want to make does have two integer properties it will use in its computation). Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted August 19, 2020 Share Posted August 19, 2020 For your case, I suggest using the one simply labeled "Effect". It's a custom Winforms template that allows you to use the Winforms Designer in Visual Studio. "PropertyBasedEffect" is what CodeLab would generate for you, and thus, would not be appropriate. 2 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted August 19, 2020 Share Posted August 19, 2020 Are you planning on sharing this plugin? If not, it may be easier to use CodeLab to calculate your info in PreRender() and report it to you in the Debug window. 1 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Modus Ponens Posted August 19, 2020 Author Share Posted August 19, 2020 I am planning on sharing it, but thanks for the suggestion. Now I just need to figure out why Windows Form Designer is so heinously busted. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted August 20, 2020 Share Posted August 20, 2020 36 minutes ago, Modus Ponens said: Now I just need to figure out why Windows Form Designer is so heinously busted. I too have issues with the designer. Here's what I can suggest: Put the designer window on your primary monitor if using more than one. Reset the system DPI scaling to 100% Delete the OBJ folder for the project prior to (re)building it. 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...
Modus Ponens Posted August 20, 2020 Author Share Posted August 20, 2020 Thank you, I will try this. 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.