Pantaleao Posted November 24, 2007 Share Posted November 24, 2007 Very, very useful plugin! Thanks a lot!! Just two suggestions tho: 1. you should remove "if (selectionRegion.IsVisible(x, y))" from your code, as it's not needed and slows the execution of the plugin. 2. you should remove version info from the name of the dll, so that a simple overwriting would update it for the user. Quote "Be who you are and say what you feel because those who mind don't matter and those who matter don't mind." ~Dr. Seuss Link to comment Share on other sites More sharing options...
I Like Pi Posted November 24, 2007 Share Posted November 24, 2007 Btw, is there any way to change the angle of the diagonal lines? This is what I cooked up with GDI+. Lines with a width greater than 1 don't work nicely currently. This is not a codelab script and requires version 3.20. It currently has a few bugs, probably from mathematical inaccuracies. DiagonalLines.zip Quote Link to comment Share on other sites More sharing options...
jsonchiu Posted November 25, 2007 Author Share Posted November 25, 2007 I just did some modification (after reviewing trig stuff). Can anybody just do some interface work for me? Codelab doesn't allow 4 sliders... (duh) int Amount1=40; //[3,200] Scanline Interval int Amount2=1; //[1,200] Brush Width int Amount3=5; //[0,9] Antialias Level int Amount4=45; //[0,179] Angle void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; ColorBgra CurrentPixel; //modifying my (x + y) % Amount1 Algorithm, we multiply the x and y by certain value double xfactor = 1; double yfactor = 1; //if y is longer than x, we modify y factor, and vice versa if (Amount4 <= 45 || (Amount4 > 135 && Amount4 < 225) || Amount4 > 315) { yfactor = Math.Tan(Amount4 * (3.14159/180)); } else { xfactor = 1 / Math.Tan(Amount4 * (3.14159/180)); } for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { if (selectionRegion.IsVisible(x, y)) { CurrentPixel = src[x,y]; double testnum = (x*xfactor + y*yfactor); if (testnum < 0) { //make the number a positive before doing the modular (%) operation testnum = testnum + Amount1 * 1000000; } double modular = testnum % Amount1; //if modular < thickness if (modular < Amount2) { if ((int)(PrimaryColor.A) == 255) { CurrentPixel.R = (byte)PrimaryColor.R; CurrentPixel.G = (byte)PrimaryColor.G; CurrentPixel.B = (byte)PrimaryColor.B; CurrentPixel.A = (byte)PrimaryColor.A; } else { //some code to multiply color to alpha int alpha = (int)(PrimaryColor.A); int inv_alpha = 255 - alpha; CurrentPixel.R = (byte)(((int)(PrimaryColor.R) * alpha + (int)(CurrentPixel.R) * inv_alpha) / 255); CurrentPixel.G = (byte)(((int)(PrimaryColor.G) * alpha + (int)(CurrentPixel.G) * inv_alpha) / 255); CurrentPixel.B = (byte)(((int)(PrimaryColor. * alpha + (int)(CurrentPixel. * inv_alpha) / 255); if ((int)(CurrentPixel.A) < (int)255) { int temp; if ((int)(PrimaryColor.A) + (int)(CurrentPixel.A) >= 255) { temp = 255; } else { temp = (int)(PrimaryColor.A) + (int)(CurrentPixel.A); } CurrentPixel.A = (byte)(((int)(CurrentPixel.A) + temp) / 2); } else { CurrentPixel.A = (byte)255; } } } else if (Amount3 > 0) { //if pixel is beside the line, we do our antialias operation if (modular <= Amount2 + 1 || modular >= Amount1 - 1) { double factor = 0; if (modular >= Amount1 - 1) { factor = 1 - (modular - Amount1 + 1); } else { factor = 1 - (Amount2 - modular + 1); } //hacks to get around special angles if (Amount4 == 45) { factor += 0.8; } else if (Amount4 == 90) { factor = 0; } else if (Amount4 == 135) { factor -= 0.7; } //our antialias routine int mul = (int)((10 - Amount3) * factor); int div = mul + 1; CurrentPixel.R = (byte)(((int)(PrimaryColor.R) + mul * (int)(CurrentPixel.R)) / div); CurrentPixel.G = (byte)(((int)(PrimaryColor.G) + mul * (int)(CurrentPixel.G)) / div); CurrentPixel.B = (byte)(((int)(PrimaryColor. + mul * (int)(CurrentPixel.) / div); //alpha multiplication if ((int)(CurrentPixel.A) < (int)255) { int temp; if ((int)(PrimaryColor.A) + (int)(CurrentPixel.A) >= (int)255) { temp = 255; } else { temp = (int)(PrimaryColor.A) + (int)(CurrentPixel.A); } CurrentPixel.A = (byte)((temp + mul * (int)(CurrentPixel.A)) / div); } else { CurrentPixel.A = (byte)255; } } } //and we are done dst[x,y] = CurrentPixel; } } } } Quote Some links: | Personal Website | Alien Attack | Try out my plugins: | Antialias | Diagonal Lines | Link to comment Share on other sites More sharing options...
pyrochild Posted November 25, 2007 Share Posted November 25, 2007 I just did some modification (after reviewing trig stuff).Can anybody just do some interface work for me? Codelab doesn't allow 4 sliders... (duh) [blah] I'd do it, but Rick still has breaking changes planned for the 3.20's plugin system. It seems silly to me to write code that you know is going to stop working in a week or two... Once 3.20 goes GM, though, I'd be happy to do it. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
jsonchiu Posted December 26, 2007 Author Share Posted December 26, 2007 *completed!* Finally different angles! Note: the source code is quite messy... just 'cause I haven't touched Visual Studio for months. Quote Some links: | Personal Website | Alien Attack | Try out my plugins: | Antialias | Diagonal Lines | Link to comment Share on other sites More sharing options...
toe_head2001 Posted December 27, 2007 Share Posted December 27, 2007 If you can have different angles now, should it still be called Diagonal Lines? Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Pantera1395 Posted December 27, 2007 Share Posted December 27, 2007 I'm havin a bit of trouble installing this one. I put it in the correct spot, then load pdn, but it doesn't show. Instead of taking an hour to figure out what I did wrong, I'll just ask it here. [Damn I posted a n00b question!!! ] Quote Myspace, Hack this site.org, My DAmn page Link to comment Share on other sites More sharing options...
jsonchiu Posted December 27, 2007 Author Share Posted December 27, 2007 Make sure you download the dll (and don't confuse it with the zip, which contains the source code), and then put it in the Effects folder. Then restart pdn. Make sure you delete old versions. Quote Some links: | Personal Website | Alien Attack | Try out my plugins: | Antialias | Diagonal Lines | Link to comment Share on other sites More sharing options...
Pantera1395 Posted December 27, 2007 Share Posted December 27, 2007 Make sure you download the dll (and don't confuse it with the zip, which contains the source code), and then put it in the Effects folder.Then restart pdn. Make sure you delete old versions. Ok, got it Quote Myspace, Hack this site.org, My DAmn page Link to comment Share on other sites More sharing options...
Pantera1395 Posted December 27, 2007 Share Posted December 27, 2007 Sry about that :oops: , my transvestite OS makes downloads behave differently. Lol :wink: Quote Myspace, Hack this site.org, My DAmn page Link to comment Share on other sites More sharing options...
Frozen_byte Posted January 5, 2008 Share Posted January 5, 2008 Plugin Crash report: Settings: Scanline: 4 Brush: 2 AA: 8 Angle: Crushed while swichtching from 135 to 134 hers the Technical report: Datei: P:\Grafik\Paint.NET\Effects\Diagonal Lines.dll Effektname: DiagonalLines.EffectPlugin Vollständige Fehlermeldung: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.DivideByZeroException: Attempted to divide by zero. at DiagonalLines.EffectPlugin.Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, Int32 startIndex, Int32 length) at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderImpl() --- End of inner exception stack trace --- at PaintDotNet.Effects.BackgroundEffectRenderer.Join() at PaintDotNet.Effects.BackgroundEffectRenderer.Start() at PaintDotNet.Menus.EffectMenuBase.<>c__DisplayClassa.b__8(Object sender, EventArgs e) [E] Tryed that a second one, it crashed again! [/E] Quote Link to comment Share on other sites More sharing options...
Martje Posted January 26, 2008 Share Posted January 26, 2008 This is the plugin I'm looking for made my own userbars, very useful plugin Well done. Thank you! Quote My own DeviantART gallery Link to comment Share on other sites More sharing options...
bigg1234 Posted July 31, 2008 Share Posted July 31, 2008 loks really cool but im having trouble downloading this i have it downloaded to my effects folder and restarted paint.net but it wont work help! :shock: Quote signature by:me Link to comment Share on other sites More sharing options...
Bigtom71291 Posted August 21, 2008 Share Posted August 21, 2008 i really need this plug in but i can't get this to work :oops: the download doesnt work i get this error but i rite clicked & downloaded it & then i put in the effects folder but it does not show up so can some one please help Quote Link to comment Share on other sites More sharing options...
Gamer_World14 Posted August 22, 2008 Share Posted August 22, 2008 I am having the same problem, I try right clicking then saving, but yet it won't show up anywhere in the effects. I also tried going to the site by typing the url in the search bar and it says that the server is forbidden. Could you try and save the file on a different file sharing site like mediafire or something. Cause this effect sounds very useful to me and I would like to have it badly. Quote deviantART | Paint.NET Gallery | bennettfrazier.com <-- (My new Website!) Link to comment Share on other sites More sharing options...
Noodlez Posted August 24, 2008 Share Posted August 24, 2008 ^^ i got the same problem Quote My DeviantART | Link to comment Share on other sites More sharing options...
kirby145 Posted August 25, 2008 Share Posted August 25, 2008 Hey guys I'll mirror the download for you, until he fixes it jsonchiu's Diagonal lines v2.0 (zip) http://dl.getdropbox.com/u/40180/Diagonal%20Lines.zip Really is a great plugin Quote "By trying to reinvent the wheel every time we find very often with square wheels" ...X-blaster Link to comment Share on other sites More sharing options...
Gamer_World14 Posted August 25, 2008 Share Posted August 25, 2008 Hey guys I'll mirror the download for you, until he fixes itjsonchiu's Diagonal lines v2.0 (zip) http://dl.getdropbox.com/u/40180/Diagonal%20Lines.zip Really is a great plugin Great, thank you so much! I will really enjoy this plugin Hopefully the author does this too so he can get more downloads on his awesome plugin, lol Quote deviantART | Paint.NET Gallery | bennettfrazier.com <-- (My new Website!) Link to comment Share on other sites More sharing options...
wiirus Posted May 15, 2009 Share Posted May 15, 2009 I love it. very, very useful. Quote I'm still learning, trying to get better. Critics, even bad ones, help me. Link to comment Share on other sites More sharing options...
painter0n Posted May 17, 2009 Share Posted May 17, 2009 you could just use the fill patterns to make diagonal lines Quote jocuri100 juegos100 Link to comment Share on other sites More sharing options...
Gamer_World14 Posted May 17, 2009 Share Posted May 17, 2009 you could just use the fill patterns to make diagonal lines But this plugin allows a wider variety of options, such as spacing between the lines, the size of the lines, etc. so I am not sure the pattern tool is the best option. Quote deviantART | Paint.NET Gallery | bennettfrazier.com <-- (My new Website!) Link to comment Share on other sites More sharing options...
0rac1e Posted July 19, 2009 Share Posted July 19, 2009 I'm not very hot on these things. How do I access the effects folder? Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 19, 2009 Share Posted July 19, 2009 Read this: viewtopic.php?f=16&t=2023&start=0 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...
0rac1e Posted July 20, 2009 Share Posted July 20, 2009 Thanks a lot. Got it sorted, now. Quote Link to comment Share on other sites More sharing options...
bennetg14 Posted July 20, 2009 Share Posted July 20, 2009 how come it makes so much lines? :? 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.