R3VENGE Posted January 13, 2008 Share Posted January 13, 2008 ive just started wanting to know how to make an effect its still a bit complicated seeing as the ony expierience if had has been with html at school which was very simple and we only learnt how to make a website with just text lol. im gonna start with htis and i might try to play around with some other simple effects. hopefully i want to make one which takes the current selection and copies it and pastes it everywhere so sort of like a landscape gen thing. it might be complicated lol and well it may take a few years for me to learn dll Quote psn id: R3V-fiR3 Link to comment Share on other sites More sharing options...
Aziz Posted May 13, 2008 Share Posted May 13, 2008 Wait a second, what is 'rect'? Shouldn't one be using 'selection', as rect isn't even defined in that code. I just ran into a bunch of headache where I was using the bounds of rect to do my looping. It working fine for loops like so: for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; if (x % 2 == 0 && y % 2 == 0) dst[x,y] = PrimaryColor; } } But when I tried the following, I found that rect.Bottom and rect.Top where MOVING during the loop. O_O: for(int y = rect.Top; y < rect.Bottom; y++) { dst[rect.Bottom, y] = PrimaryColor; } That code isn't supposed to do anything useful, but it show that rect.Bottom is incrementing every iteration. Perhaps every time a change is made to dst. I don't have Visual Studio on this machine so I'm using CodeLab and thus no debugging. Using selection Rectangle solves this awkwardness. Quote http://aaziz.org | Outline Selection Plugin | Gallery of Aziz Link to comment Share on other sites More sharing options...
Simon Brown Posted May 13, 2008 Share Posted May 13, 2008 Wait a second, what is 'rect'? Shouldn't one be using 'selection', AFAIK that is because the code you enter will be run several dozen times on different parts of the image - that area isn't necessarily the selection - just one part of it. Just my 20 pence. Quote Link to comment Share on other sites More sharing options...
Aziz Posted May 13, 2008 Share Posted May 13, 2008 Oh, I see, that makes sense if that's the case. Should all plugins, then, be in the form of: ColorBgra current; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { current = src[x,y]; // TODO: Add pixel processing code here if (somecondition) { current = ; //modify current pixel } dst[x,y] = current; } } I'm going to have to look at some of the other plugins after lunch. Quote http://aaziz.org | Outline Selection Plugin | Gallery of Aziz Link to comment Share on other sites More sharing options...
BoltBait Posted May 13, 2008 Author Share Posted May 13, 2008 I'm going to have to look at some of the other plugins after lunch. You may want to read this: CodeLab Overview. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Aziz Posted May 13, 2008 Share Posted May 13, 2008 Yeah I remembered that bit about splitting it into parts to render. And it makes sense - instead of rendering the bottom line, it was drawing a line every 10 px or so. That article really cleared up any uncertainties, thanks! Quote http://aaziz.org | Outline Selection Plugin | Gallery of Aziz Link to comment Share on other sites More sharing options...
Sharp Posted December 6, 2009 Share Posted December 6, 2009 Cool stuff. Working on learning C# right now, this will be fun to mess around with once I get some of it down. Quote [Glass Ball Tutorial] [My Gallery] [starscape Tutorial] [My Sig Tutorial] [My dA] Link to comment Share on other sites More sharing options...
verdy_p Posted December 17, 2009 Share Posted December 17, 2009 A minor thing to change immediately in CodeLab would be to have a "Pause" button, so that the code will not be executed as we are editing it. Sometimes, I type code, and the fact that it runs immediately, despite it is not complete, can cause the code to turn into an infinite loop. This caused CodeLab and in fact all of PaintDotNet to become unresponsive, and I had to kill the process. For this reason, I generally don't edit code in CodeLab itself, but in an safer external editor, and I use full copy/paste operations from the external editor into the CodeLab window. But this is irritating (note that when pasting code in CodeLab, there's a lengthy scrollbar operation running, just to recolor the text (note one minor bug in this coloring: it recolors keywords found in comments.) One way to avoid the immediate execution is to start editing after leaving a syntax error, for example a "=" sign alone on the first line at the begining of the script. To effectively run the script, just remove that equal sign. I wonder if CodeLab could not simply just monitor the content of a filename (edited and saved from an external editor) and then automatically refresh itself by loading it after it has been closed by the other application, without bothering displaying and coloring it in its window. It will just perform the compilation and execution task in this case: in this case, if the code immediately crashes or hangs in an infinite loop, nothing is lost if we kill PaintDotNet from the task manager. However, the status window should first display the correct line numbers in case of compilation errors (not the line numbers after the automatically generated and hidden lines, so that they can be easily found in the external editor), and we won't even need the code frame in this case : the status frame could take the full height of the window below the menu, and the CodeLab window could be reduced in height; or the code window could be replaced by the automatically generated parameters controls, if there's no compilation error. Quote Link to comment Share on other sites More sharing options...
ninja Posted July 18, 2010 Share Posted July 18, 2010 (edited) where could I learn c# boltbait? + when do you use the { or why do you use them? Edited July 18, 2010 by ninja Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 18, 2010 Author Share Posted July 18, 2010 where could I learn c# boltbait? + when do you use the { or why do you use them? Try this: http://tinyurl.com/36dnk7q Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
johnsonkid Posted May 20, 2011 Share Posted May 20, 2011 < I came, I saw, I posted something dim and then EER came and removed it for me - what a guy!> Quote I'm a dumb spammer - EER fixed me. Link to comment Share on other sites More sharing options...
Bobby99z Posted September 25, 2011 Share Posted September 25, 2011 Is it possible to to use visual studio 2010? Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted September 25, 2011 Share Posted September 25, 2011 Yes, but much more complex. I use VS 2010 Express Edition. Codelab is a much easier introduction to C# and effect coding 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...
Guest begirl001 Posted February 18, 2012 Share Posted February 18, 2012 Great tut Boltbait! Quote Link to comment Share on other sites More sharing options...
RSguideMaker Posted September 2, 2012 Share Posted September 2, 2012 Awesome tutorial BoltBait. It has gone on my bookmark bar for when I'm not so tired. Coding things is very hard when tired, and can often lead to many mistakes. So when I'm awake more, I will have a look at what plugins aren't available & what features PDN doesn't have, so I can work from there. 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.