BoltBait Posted October 4, 2013 Share Posted October 4, 2013 What type of code does it use? Please read the first post in this thread. It gives an overview of this coding environment. Then, if you are ready, you can read a series of tutorials on my web site on how to create effects with Paint.NET CodeLab. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
MJW Posted October 17, 2013 Share Posted October 17, 2013 (edited) I have a user interface problem. I'm writing a codelab plugin that has three color wheels. It works when I run the source code, but when I build the DLL, instead of using the assigned colors, the first color wheel uses the primary color and the other two use the secondary color. The compiled code shows that those are the colors that get initialized. I'm using codelab verson 1.8, which is, I believe, the current version. Am I doing something wrong, or, if not, is there a fix or workaround? Source code: #region UICode ColorBgra Amount1 = ColorBgra.FromBgr(60,140,170); // Surface Color ColorBgra Amount2 = ColorBgra.FromBgr(0,0,0); // Lowlight Color ColorBgra Amount3 = ColorBgra.FromBgr(255,255,255); // Highlight Color double Amount4 = 0.4; // [0,1] Lowlight Upper Limit double Amount5 = 0; // [-1,1] Lowlight Nonlinearity double Amount6 = 0.8; // [0,1] Highlight Lower Limit double Amount7 = 0; // [-1,1] Highlight Nonlinearity double Amount8 = 0.299; // [0,1] Red Weight double Amount9 = 0.587; // [0,1] Green Weight double Amount10 = 0.114; // [0,1] Blue Weight #endregion Compiled code: protected override PropertyCollection OnCreatePropertyCollection() { List<Property> props = new List<Property>(); props.Add(new Int32Property(PropertyNames.Amount1, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.PrimaryColor.B,EnvironmentParameters.PrimaryColor.G,EnvironmentParameters.PrimaryColor.R,255)), 0, 0xffffff)); props.Add(new Int32Property(PropertyNames.Amount2, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.SecondaryColor.B,EnvironmentParameters.SecondaryColor.G,EnvironmentParameters.SecondaryColor.R,255)), 0, 0xffffff)); props.Add(new Int32Property(PropertyNames.Amount3, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.SecondaryColor.B,EnvironmentParameters.SecondaryColor.G,EnvironmentParameters.SecondaryColor.R,255)), 0, 0xffffff)); props.Add(new DoubleProperty(PropertyNames.Amount4, 0.4, 0, 1)); props.Add(new DoubleProperty(PropertyNames.Amount5, 0, -1, 1)); props.Add(new DoubleProperty(PropertyNames.Amount6, 0.8, 0, 1)); props.Add(new DoubleProperty(PropertyNames.Amount7, 0, -1, 1)); props.Add(new DoubleProperty(PropertyNames.Amount8, 0.299, 0, 1)); props.Add(new DoubleProperty(PropertyNames.Amount9, 0.587, 0, 1)); props.Add(new DoubleProperty(PropertyNames.Amount10, 0.114, 0, 1)); return new PropertyCollection(props); } Edited October 17, 2013 by MJW Quote Link to comment Share on other sites More sharing options...
Red ochre Posted October 17, 2013 Share Posted October 17, 2013 Hello MJW, Codelab always does that - and sets the double vector position boxes to the centre too.If you take the code output from codelab, then copy and paste it into the plugin template for Visual Studio you can then set the initial colors to what you want.Have read through this thread if setting up Visual Studio is a problem. http://forums.getpaint.net/index.php?/topic/25828-help-needed-using-visual-studio-instead-of-codelab-for-developing/ Best of luck! 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
MJW Posted October 17, 2013 Share Posted October 17, 2013 Thank you very much, Red ocre. If I can't find a some trick using codelab to get around the UI bug, I may give the idea of building in Visual Studio a try. I'd prefer to do something within codelab, just because that's what I'm used to. Probably once I got things working under Visual Studio, I'd be glad I switched over, but it seems like quite a bit of effort just to get one silly little plugin working. Quote Link to comment Share on other sites More sharing options...
Felix The Ghost Posted November 8, 2013 Share Posted November 8, 2013 (edited) Hey, great work. Very easy to work with and well documented. However, I feel a feature this is lacking (or perhaps I missed the documentation of it) is utilizing the new drop-down feature for presets. I know, you technically can select and use psedo-presets but I'd like Codelab to have a method of updating the users sliders to reflect values set from a preset (or the randomize button) It appears the Amountx values are written to by the users sliders but not vice-versa (makes sense though I wish there was a way to write to the sliders) Example (ignoring that Amounts2-4 would keep getting reassigned without a hypothetical detectChange() and updateSliders() method. #region UICode byte Amount1 = 0; // Use Preset|Custom|First Preset ... if (Amount1 != 0) //not custom { Amount2 = 5; //preset values (does not update sliders intuitively for user to tweak) Amount3 = 10; //preset values (does not update sliders intuitively for user to tweak) Amount4 = 15; //preset values (does not update sliders intuitively for user to tweak) } Again hopefully there is a way I just failed to notice but if not this would be much appreciated functionality for many. Edited November 8, 2013 by Felix The Ghost Quote Link to comment Share on other sites More sharing options...
BoltBait Posted November 9, 2013 Share Posted November 9, 2013 You are right. The Amount variables are read only. This is a limitation of the Paint.NET plugin Indirect UI. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Spair Posted January 15, 2014 Share Posted January 15, 2014 While this may be fun, hasn't just about everything been done already (other than bug fixes & UI alterations)? Quote I wish we'd all been ready. Link to comment Share on other sites More sharing options...
BoltBait Posted January 15, 2014 Share Posted January 15, 2014 While this may be fun, hasn't just about everything been done already (other than bug fixes & UI alterations)? Every time I think that, I'm surprised by the creativity of the programmers here at the forums. By the way, I've just started making changes to CodeLab to support Paint.NET 4.0. I added the 3D Roll Control last night and I've got some more ideas on the way. (BTW, this is not published yet. I will publish it all together when 4.0 is launched.) 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
david.atwell Posted January 15, 2014 Share Posted January 15, 2014 While this may be fun, hasn't just about everything been done already (other than bug fixes & UI alterations)? In 1898, the commissioner of the US Patent Office reportedly said, "Everything that can be invented has been invented."* In 1943, the CEO of IBM reportedly said, "I think there is a world market for maybe five computers."* In 1962, the Decca Recording Company rejected the Beatles, saying "Guitar groups are on the way out." If you ever think you've seen it all, you're probably wrong. :-) *(Full disclosure: the first two quotes have contested attribution to those men, but the Decca Beatles rejection is very well documented.) 1 Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
Red ochre Posted January 15, 2014 Share Posted January 15, 2014 Personally, I find that every new plugin I write (or attempt to), leads to ideas for atleast another three! Sadly I do not always have the skills to make them (aargh those nasty R.O.I.s!). The thought that interested and capable programmers have run out of ideas seems such a waste of talent. The forum rules stress that 'this is not a plugin request thread' (Plugin Developer's Central). Perhaps there should be a thread for (experienced) users to describe workable ideas for possible plugins ? - Any interested developers could express an interest in a project (to avoid duplication) and perhaps the combined knowledge and shared source code would be useful for all?Regarding codelab - it does have limitations but is still very useful. I found codelab far less intimidating than Visual Studio as a place to start learning C#. It is inevitable that there will be duplication of ideas for the simpler plugins but sometimes having the choice of 2 or 3 similar plugins is a good thing. Small differences can be crucial for how useful an effect is. Plugins can easily be uninstalled if you have one that does what you need already. Also, I think it is good to encourage new plugin writers as you never know what they may come up with for their next plugin!@David - Apparently the Victorians thought they had physics wrapped up but Einstein had other ideas! 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
TechnoRobbo Posted January 16, 2014 Share Posted January 16, 2014 (edited) While this may be fun, hasn't just about everything been done already (other than bug fixes & UI alterations)? You can't give up before you start. If you can't think of a new idea then build a better mouse trap ( you'll catch the smarter mice). I come up with ideas just reading through the forum. I have several ideas I still want to try. Notice I said "try". I don't predetermine my limits, and any failure is learning experience. I use CodeLab for rapid prototyping - all my plugins started in CodeLab whether they ended up there or not. Edited January 16, 2014 by TechnoRobbo 1 Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
Crimden Posted January 19, 2014 Share Posted January 19, 2014 Looks useful but I don't code. Quote Link to comment Share on other sites More sharing options...
david.atwell Posted January 19, 2014 Share Posted January 19, 2014 Not every plugin is for everyone. Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
Spair Posted January 21, 2014 Share Posted January 21, 2014 By the way, I've just started making changes to CodeLab to support Paint.NET 4.0. I added the 3D Roll Control last night and I've got some more ideas on the way. (BTW, this is not published yet. I will publish it all together when 4.0 is launched.) Then I'll wait until those are released or are revealed not to be. >thanks for the input, people. Quote I wish we'd all been ready. Link to comment Share on other sites More sharing options...
BoltBait Posted March 5, 2014 Share Posted March 5, 2014 I was developing the next version of CodeLab last night and I'm thinking of making a change of where the DLL file is generated. Currently, it puts the DLL file in the Paint.NET Effects folder. This requires Paint.NET to be run as Administrator when developing plugins. This causes other problems, like you can't drag-and-drop files onto Paint.NET in order to open them, etc. I've never liked this limitation. In the next version of CodeLab, I'm going to have CodeLab build DLL files to the user's desktop. In order to see these newly built effects in Paint.NET you will need to move the DLL file to Paint.NET's Effects folder and restart Paint.NET. I feel confident that plugin developers will not have any trouble handling this. With this change, Paint.NET will no longer have to "run as" Administrator in order to use CodeLab. Anyone have heartburn with this change? 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
midora Posted March 5, 2014 Share Posted March 5, 2014 I'm happy with this change because this was the reason why I never used the save as dll functionality. But maybe you should allow to set a path (default to desktop). This could also satisfy the 'administrator' users. 1 Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted March 5, 2014 Share Posted March 5, 2014 ... maybe you should allow to set a path (default to desktop). This could also satisfy the 'administrator' users. Great idea. 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...
BoltBait Posted March 6, 2014 Share Posted March 6, 2014 Great idea. I'll be the judge of that! And, nope. I'm just going to put the built DLL file on the user's desktop. Deal with it. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
midora Posted March 6, 2014 Share Posted March 6, 2014 I'll be the judge of that! You are just the judge who decides what will be implemented. Not the judge who decides what's a good idea. ;-) Everything is better than writing the the dll into the Program files folder. Desktop just means that you always have to hide all windows and search where it is placed this time. Like looking for the crash log of the old Paint.NET. Quote Link to comment Share on other sites More sharing options...
david.atwell Posted March 6, 2014 Share Posted March 6, 2014 you always have to hide all windows and search where it is placed this time Window+D Type first letter of plugin ??? Profit!! Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
midora Posted March 6, 2014 Share Posted March 6, 2014 Window+D Type first letter of plugin ??? Profit!! Thanks, but you know that you just translated one sentence into four? ;-) Quote Link to comment Share on other sites More sharing options...
BoltBait Posted March 6, 2014 Share Posted March 6, 2014 Thanks, but you know that you just translated one sentence into four? ;-) http://knowyourmeme.com/memes/profit Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
midora Posted March 6, 2014 Share Posted March 6, 2014 OK, I thought it's about exchanging arguments to get a good solution. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted March 6, 2014 Share Posted March 6, 2014 I still like the idea. Lower-end users will have the desktop default. Power users will set the path of their innermost desire. Everybody happy. If I have to copy the *.dll from the desktop every time I will cry 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...
BoltBait Posted March 6, 2014 Share Posted March 6, 2014 Get your tissues ready. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game 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.