Mike Ryan Posted May 20, 2008 Share Posted May 20, 2008 Alright, CodeLab keeps crashing and it is by calling integers. If I were to call on an int x and then give value to it later on CodeLab completely stalls up. Are there particular variables that are not allowed because of the plugin template? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted May 20, 2008 Share Posted May 20, 2008 Alright, CodeLab keeps crashing and it is by calling integers. If I were to call on an int x and then give value to it later on CodeLab completely stalls up. Are there particular variables that are not allowed because of the plugin template? Of course! Let's look at the default script: #region UICode int Amount1=0; //[0,100]Slider 1 Description int Amount2=0; //[0,100]Slider 2 Description int Amount3=0; //[0,100]Slider 3 Description #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left); long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor; int BrushWidth = (int)EnvironmentParameters.BrushWidth; ColorBgra CurrentPixel; for(int y = rect.Top; y { for (int x = rect.Left; x { CurrentPixel = src[x,y]; // TODO: Add pixel processing code here // Access RGBA values this way, for example: // CurrentPixel.R = (byte)PrimaryColor.R; // CurrentPixel.G = (byte)PrimaryColor.G; // CurrentPixel.B = (byte)PrimaryColor.B; // CurrentPixel.A = (byte)PrimaryColor.A; dst[x,y] = CurrentPixel; } } } Obviously, you can't use the following variables: Amount1, Amount2, Amount3... etc. -- these are use for UI elements dst, src -- pointers to the destination and source surfaces rect -- rectangle of the current part of the selection that we are working on selection -- this is used to get the bounds of the current selection CenterX, CenterY -- used to point to the center pixel of the current selection PrimaryColor, SecondaryColor -- used to hold current color values BrushWidth -- used to hold the current brush width as set in the main PdN UI CurrentPixel -- used in the main loop for working with the current pixel x, y -- loop variables That's about it. Of course, there are others, but these are the obvious ones. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
Mike Ryan Posted May 20, 2008 Share Posted May 20, 2008 The only one I am having trouble for is x and I didnt think about looking at x,y. Thanks for clearing it up! Quote Link to comment Share on other sites More sharing options...
Philip© Posted June 23, 2008 Share Posted June 23, 2008 Excuse me, I have a problem with codelab. When I click "Build dll" button an error message appears. it says "Error at line 0: Impossible to create 'c:/Program Files/Paint.NET/Effects/CSC68A7.tmp' temporary file -- Access denied. (CS1619). What shall I do? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 23, 2008 Share Posted June 23, 2008 You need to be on an Admin account to build effect DLL's. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
Simon Brown Posted June 23, 2008 Share Posted June 23, 2008 You need to be on an Admin account to build effect DLL's. Clarification: On your computer, not the forums. The statement sounded to me like the latter. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 16, 2008 Share Posted July 16, 2008 There is a bug in Version 1.0 of CodeLab. Every plugin built by this version that contains a color wheel contains the bug. To see the bug, select a color in the color docker window that is not 100% opaque, then run an effect built by CodeLab that contains a color wheel control. This causes an unhandled exception in the plugin that is caught by Paint.NET. No data loss should occur. I will publish a fixed version of CodeLab soon. When a revised CodeLab is published, developers will only need to rebuild an effected plugin to fix the problem. I already have the fix working on my computer. I will test it and publish very soon. Workaround: Users, be sure that your primary color's opacity is set to 255 (100%) before running any plugin built by CodeLab. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
heri Posted July 17, 2008 Share Posted July 17, 2008 Hey Guys! I'm new to this forum, and new to CodeLab. I downloaded CodeLab yesterday, and went to see BoltBaits tutorials. I made the Colour Balance Effect, but when I went to File > Save As DLL I get this error: Error at line 0: Cannot create temporary file 'c:\Program Files\Paint.NET\Effects\CSC1120.tmp' -- Access denied. (CS1619) I am on the Administrator Account of this computer, as it is the only account. I am not sure what else to try. Could anyone please help me? Also, I downloaded the Plug-in from BoltBait's CodeLab page, by clicking the link in his signature. Thanks, heri! Quote Link to comment Share on other sites More sharing options...
Mike Ryan Posted July 17, 2008 Share Posted July 17, 2008 If you are running in Vista, try running Paint.NET as an administrator (Yes, I know you are on an administrator account, but if you right click on a shortcut or .exe file you should see the option to run as administrator) Quote Link to comment Share on other sites More sharing options...
heri Posted July 18, 2008 Share Posted July 18, 2008 If you are running in Vista, try running Paint.NET as an administrator (Yes, I know you are on an administrator account, but if you right click on a shortcut or .exe file you should see the option to run as administrator) Yes, I am running Vista, and I read your post, and tried it. I now am discovering even more errors for some reason. I do not know what the problem is, but now I am getting at least 10 errors instead of just that one. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 28, 2008 Share Posted July 28, 2008 CodeLab 1.1 has been released. 1.1 Release - Colorwheel Bug Fixed - Fixed a bug where the namespace could have bad characters in it - Second colorwheel in a UI now defaults to secondary color - Floating point slider control added (requested by MadJik) - Drop-Down List Box control added - "UserBlendOp" control added - Script comment parsed for default effect name: // Name: Effect Name - Minor UI typo fixes Go get it here: http://boltbait.com/pdn/codelab/ Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
earlier Posted July 28, 2008 Share Posted July 28, 2008 very helpful! where can I get zip'sample? think you! Quote Link to comment Share on other sites More sharing options...
Mike Ryan Posted July 28, 2008 Share Posted July 28, 2008 You mean sample code? My just published Silhouette Plus plugin contains the source code with examples on how to use the drop down menu. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 28, 2008 Share Posted July 28, 2008 CodeLab 1.1 has been released.1.1 Release - Colorwheel Bug Fixed - Fixed a bug where the namespace could have bad characters in it - Second colorwheel in a UI now defaults to secondary color - Floating point slider control added (requested by MadJik) - Drop-Down List Box control added - "UserBlendOp" control added - Script comment parsed for default effect name: // Name: Effect Name - Minor UI typo fixes Go get it here: http://boltbait.com/pdn/codelab/ By the way, the CodeLab help file has been updated with a ton of example scripts here: http://www.boltbait.com/pdn/codelab/hel ... ments.asp And, the source code to CodeLab itself has been published to the bottom of this page: http://boltbait.com/pdn/codelab/ Enjoy. 8) Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 29, 2008 Share Posted July 29, 2008 CodeLab 1.1 has been released. And a wonderful upgrade it is too :!: I can't thank you enough BoltBait, particularly for the Drop-Down List Box and the BlendOp controls. I'm gonna have so much fun with these [edit] I was wondering if any of the controls can be set dynamically? Specifically the drop-down listbox. Can I populate the list at *.dll runtime (say with a list of fonts gleaned from the users PC)? [/edit] 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...
Mike Ryan Posted July 31, 2008 Share Posted July 31, 2008 I do not understand this // Name: Effect Name stuff at all. Can you give an example? Problem Solved Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 31, 2008 Share Posted July 31, 2008 [edit]I was wondering if any of the controls can be set dynamically? Specifically the drop-down listbox. Can I populate the list at *.dll runtime (say with a list of fonts gleaned from the users PC)? [/edit] Paint.NET IndirectUI does not support such behavior. HOWEVER... I might be able to give you something like that similar to the UserBlendOp control. Give me a few days... I do not understand this // Name: Effect Name stuff at all. Can you give an example? Mike, the File > Save as DLL screen includes several fields of information that you need to fill in in order to build a DLL. It includes things like the author's name, the Effects submenu and menu text, and a support URL that is displayed to the user if your effect fails. Here's the save screen: It is a pain to enter that info every time you go to build a DLL, so I included a shortcut... If you include a comment in your effect in the following form, the appropriate field will be filled in with the supplied default information. // FIELD: default value You can override this default before actually saving the DLL file. It is only for conveince. It has no effect on the effect at all. Here are some examples: // Author: BoltBait // Submenu: Blurs // Name: Gaussian Blur+ // URL: http://www.BoltBait.com/pdn etc. This is all explained on the following page of the help file: http://www.boltbait.com/pdn/codelab/hel ... ngdll.asp Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
Mike Ryan Posted July 31, 2008 Share Posted July 31, 2008 [edit]I was wondering if any of the controls can be set dynamically? Specifically the drop-down listbox. Can I populate the list at *.dll runtime (say with a list of fonts gleaned from the users PC)? [/edit] Paint.NET IndirectUI does not support such behavior. HOWEVER... I might be able to give you something like that similar to the UserBlendOp control. Give me a few days... That is not available through IndirectUI. Sure it is. Use the StaticListChoiceProperty. string[] fontNames = ... you figure this part out ...; StaticListChoiceProperty fontNamesProperty = new StaticListChoiceProperty(YourPropertyName, fontNames); Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 31, 2008 Share Posted July 31, 2008 ... you figure this part out ... Thanks for nothing. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
Mike Ryan Posted July 31, 2008 Share Posted July 31, 2008 Hehe Rick posted that part, not me! Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted July 31, 2008 Share Posted July 31, 2008 I have modified the CodeLab source to add a new FontList control. There may be many bugs as I am new to the CodeLab codebase. The source code was too large to attach, so PM me your email address for a copy (although note that I will probably not be able to get back to you within two weeks). Quote Link to comment Share on other sites More sharing options...
BoltBait Posted August 1, 2008 Share Posted August 1, 2008 Don't download that. It doesn't work. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
Simon Brown Posted August 1, 2008 Share Posted August 1, 2008 Don't download that. It doesn't work. Could you give me some details as to what exactly happens when you try? Thanks Quote Link to comment Share on other sites More sharing options...
BoltBait Posted August 1, 2008 Share Posted August 1, 2008 Simon, you almost had it. You just forgot to wireup the OnSetRenderInfo function so the selected font was never being return to the user. My code is a little different from yours because I had already started on the problem when you had posted. I have posted an updated CodeLab that includes the font list control. Go get CodeLab version 1.2 here: http://www.BoltBait.com/pdn/codelab Changes: - Added Font List control How to use the new control: When the Render function starts, the Amount1 FontFamily variable contains the selected font family. The name of the font can be used this way: Amount1.Name and the font can be created this way: Font MyFont = new Font(Amount1.Name, 10); where you replace 10 with the desired font size. You probably don't want to do that inside of your render loop--do it at the top of your render function. Thanks Ego Eram Reputo for supplying sample code for this control on this page: http://www.boltbait.com/pdn/codelab/hel ... asp#Fonts Quote Download: BoltBait's Plugin Pack | CodeLab | and a Computer Dominos Game Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted August 3, 2008 Share Posted August 3, 2008 Thanks Ego Eram Reputo for supplying sample code for this control on this page: http://www.boltbait.com/pdn/codelab/hel ... html#Fonts That might be my code :wink: , but the idea to draw directly to the canvas using drawing routines definitely came from MadJik when he and I were discussing a plugin which later became Random Mazes: http://paintdotnet.forumer.com/viewtopic.php?p=148303#p148303. MadJik used g.DrawLine to draw the walls of his maze and I adapted this to work with g.DrawString. I would not have figured this out by myself and simply ran with his 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...
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.