moc426 Posted May 18, 2007 Share Posted May 18, 2007 (edited) This "effect" will draw a border around image or selection with your primary color. This is like the feature in photoshop were you can "stroke" a selection. It had option to stroke outside, middle or inside. This does inside only. Perhaps I can make changes to give those options. Other enhancement would be so it can work with circular and lasso selections, not sure how I can do that yet. Simple process, has a size from 1-25 and an option to make it dashed. After border is created, distort and blur effects can be used to make it look much more interesting, that is were you get creative. Border.zip Effect is under Render -> Border. Here are some screenshots with descriptions of what I remembered being applied: Normal Dashed Dashed border, Clouds on selection, Waves, Dents Dashed border, Clouds on selection, Dents, Curves Waves Radial Blur Edit: Update 5/21/2007 ********************************** Added 2 new modes, since the dashed wasn't really dashed. - There is now line, broken (old dashed), dotted and dashed. Increased width option from 0-25 to 0-200. *new screenshot added below ********************************** Edit. source code, Codelab. Updated source added. Spoiler int Amount1 = 5; //[1,200]Thickness int Amount2 = 0; //[0,3]Line Broken Dotted Dashed void Render(Surface dst, Surface src, Rectangle rect) { // User Interface elements int GridSize = Amount1; bool line = (Amount2 == 0); bool broken = (Amount2 == 1); bool dotted = (Amount2 == 2); bool dashed = (Amount2 == 3); // Other variables PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); ColorBgra CurrentPixel; ColorBgra PrimaryColor; ColorBgra SecondaryColor; // Get the current brush width bool fill = false; // Grab the primary and secondary colors (swapping if specified in the UI) PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor; if ((dotted) || (dashed) || (broken)) { if (GridSize == 1) { GridSize = 2; } } int fillwidth = GridSize / 2; if ((broken) || (line)) { fillwidth = GridSize; } // Loop through all the pixels for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { // Only work with a pixel if it is selected // (this handles convex & concave selections) if (selectionRegion.IsVisible(x, y)) { // Get the source pixel CurrentPixel = src[x, y]; fill = false; if ((x < selection.Left + fillwidth) || (x >= selection.Right - fillwidth)) { if (dashed) { fill = true; int div = rect.Top / GridSize; bool even = false; if (div % 2 == 0) { even = true; } if (!even) { fill = false; } } else if ((broken) || (dotted)) { fill = false; int pos = (selection.Bottom - (selection.Bottom - y)) % (GridSize - 1); if ((pos == 0) || (pos < GridSize / 2)) { fill = true; } } else { fill = true; } } else if ((y <= selection.Top + fillwidth) || (y >= selection.Bottom - fillwidth)) { if (dashed) { fill = true; int div = (x - fillwidth) / GridSize; bool even = false; if (div % 2 == 0) { even = true; } if (!even) { fill = false; } } else if ((broken) || (dotted)) { fill = false; int pos = (selection.Right - (selection.Right - x)) % (GridSize - 1); if ((pos == 0) || (pos < GridSize / 2)) { fill = true; } } else { fill = true; } } if (fill) { CurrentPixel.R = (byte)PrimaryColor.R; CurrentPixel.G = (byte)PrimaryColor.G; CurrentPixel.B = (byte)PrimaryColor.B; CurrentPixel.A = (byte)PrimaryColor.A; } // Save the (modified?) pixel dst[x, y] = CurrentPixel; } } } } Edited July 3, 2018 by toe_head2001 Fixed broken DLL download & thumbnails Quote Link to comment Share on other sites More sharing options...
usedHONDA Posted May 18, 2007 Share Posted May 18, 2007 This will come to good use. Nice for simple image editing. So can I use it for the Plugin Pack I'm working on (supposing I was to finish it)? Quote "The greatest thing about the Internet is that you can write anything you want and give it a false source." ~Ezra Pound twtr | dA | tmblr | yt | fb Link to comment Share on other sites More sharing options...
Akkarins_Spirit Posted May 18, 2007 Share Posted May 18, 2007 good plugin Quote I'm not a fan-boy, i have ALL 3 of the consoles.........PS,PS2 and PS3 Link to comment Share on other sites More sharing options...
barkbark00 Posted May 18, 2007 Share Posted May 18, 2007 Akkarins_Spirit, Nice use of the "wet floor" plugin on your sig! Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
Myrddin Posted May 18, 2007 Share Posted May 18, 2007 Neat, as uH said this will indeed come in handy. Well done. May I ask, what's your screen resolution? Quote How to Save Your Images under Different File Types My dA Gallery Link to comment Share on other sites More sharing options...
usedHONDA Posted May 18, 2007 Share Posted May 18, 2007 Neat, as uH said this will indeed come in handy. Well done.May I ask, what's your screen resolution? It looks like the same as mine-- 1280x1024 (I can tell by looking at the resolution of his picture). @Akkarins_Spirit: Your sig is way to high. Quote "The greatest thing about the Internet is that you can write anything you want and give it a false source." ~Ezra Pound twtr | dA | tmblr | yt | fb Link to comment Share on other sites More sharing options...
Akkarins_Spirit Posted May 18, 2007 Share Posted May 18, 2007 ok hope its ok now, thanks barkbark Quote I'm not a fan-boy, i have ALL 3 of the consoles.........PS,PS2 and PS3 Link to comment Share on other sites More sharing options...
moc426 Posted May 18, 2007 Author Share Posted May 18, 2007 Correct 1280x1024, I want a wide screen monitor! Neat, as uH said this will indeed come in handy. Well done.May I ask, what's your screen resolution? It looks like the same as mine-- 1280x1024 (I can tell by looking at the resolution of his picture). @Akkarins_Spirit: Your sig is way to high. Quote Link to comment Share on other sites More sharing options...
Yata Posted May 18, 2007 Share Posted May 18, 2007 New pluggiinnn must have... :twisted: Quote "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former" [ dA Paint.NET Chat :: Yata on dA ] Link to comment Share on other sites More sharing options...
janet Posted May 19, 2007 Share Posted May 19, 2007 That's nice :3 Quote Link to comment Share on other sites More sharing options...
ncfan51 Posted May 19, 2007 Share Posted May 19, 2007 Nice! My work: I used orange border+dents+transparent gradient. I call it "forest fire!" Quote +_+_+_+_+_+_+_+_+_+_+_+ I am a disco dancer. +_+_+_+_+_+_+_+_+_+_+_+ Link to comment Share on other sites More sharing options...
dragonpyro Posted May 20, 2007 Share Posted May 20, 2007 Finally! A border plug-in. Thanks so much Madjik! I've been waiting a long time for one of these. I did find a bug: If you try to add a border to a circle, it turns out as a square with the corners cut off. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted May 20, 2007 Share Posted May 20, 2007 I did find a bug: If you try to add a border to a circle, it turns out as a square with the corners cut off. Thus, his original post: ...Other enhancement would be so it can work with circular and lasso selections, not sure how I can do that yet... 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...
moc426 Posted May 20, 2007 Author Share Posted May 20, 2007 As boltbait said, btw I am not Madjik. Finally! A border plug-in. Thanks so much Madjik! I've been waiting a long time for one of these. I did find a bug: If you try to add a border to a circle, it turns out as a square with the corners cut off. Quote Link to comment Share on other sites More sharing options...
moc426 Posted May 20, 2007 Author Share Posted May 20, 2007 Sorry didn't see your question. Sure you can use it. This will come to good use. Nice for simple image editing.So can I use it for the Plugin Pack I'm working on (supposing I was to finish it)? Quote Link to comment Share on other sites More sharing options...
pyrochild Posted May 20, 2007 Share Posted May 20, 2007 You can draw elliptical borders (among a variety of other shapes) with this: http://paintdotnet.12.forumer.com/viewtopic.php?p=43191 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...
LimeLight Posted May 25, 2007 Share Posted May 25, 2007 Is there any possible way we could use this effect to outline objects instead of the work itself? Not sure if you understand what I mean, if you don't, ask, and if you do, please help me out. It would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
MadJik Posted May 25, 2007 Share Posted May 25, 2007 Finally! A border plug-in. Thanks so much Madjik! I've been waiting a long time for one of these. I did find a bug: If you try to add a border to a circle, it turns out as a square with the corners cut off. I felt I had something to do with it! Try this with codelab: (only for square/rectangle selections/images) int Amount1=2; //[0,100]Distance from the edge int Amount2=2; //[0,100]Border width void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); long MaxX = (long)(selection.Right - selection.Left); long MaxY = (long)(selection.Bottom - selection.Top); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; ColorBgra CurrentPixel; 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]; if ((x>=Amount1) && (x=Amount1) && (y if ((x>=MaxX - Amount1 - Amount2) && (x=Amount1) && (y if ((x>=Amount1) && (x=Amount1) && (y if ((x>=Amount1) && (x=MaxY - Amount1 - Amount2) && (y dst[x,y] = CurrentPixel; } } } } Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
moc426 Posted May 25, 2007 Author Share Posted May 25, 2007 Not quite sure what you mean here, but if you mean I used your code as reference, I actually used boltbait's GridMaker for this one. If it makes any difference, I have referenced your code for a new plugin I am working on, as well as other code posted here by other members. I think dragonpyro wants a border around a circular selection, pyrochild's shape thing plugin can do that -> http://paintdotnet.12.forumer.com/viewtopic.php?p=43191 Finally! A border plug-in. Thanks so much Madjik! I've been waiting a long time for one of these. I did find a bug: If you try to add a border to a circle, it turns out as a square with the corners cut off. I felt I had something to do with it! Try this with codelab: (only for square/rectangle selections/images) Quote Link to comment Share on other sites More sharing options...
MadJik Posted May 25, 2007 Share Posted May 25, 2007 Not quite sure what you mean here... No pb! All code I could post here is for any forumer to use. BTW I'm not saying you have used my code. I think there is a missundertanding between our names by someone. So as an answer I tried something to create a border (from scratch)... Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
zisworg Posted June 13, 2007 Share Posted June 13, 2007 Awesome!! It's the beginning of the masks management! Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Tylast Posted June 17, 2007 Share Posted June 17, 2007 Nicely done! Anyway for the plugin to add the border to the outside of the photo & not on top of it so I don't lose pixels? Quote MuzikFetish Link to comment Share on other sites More sharing options...
Ash Posted June 17, 2007 Share Posted June 17, 2007 Image--->Canvas size---->Fill color in transparent areas. Quote All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ] Link to comment Share on other sites More sharing options...
The Singing Elf Posted July 21, 2007 Share Posted July 21, 2007 I'm sorry, but I'm new to all of this, and for some reason, this plugin is in a different format that the others I've downloaded from here, and for some reason my computer won't open the file.. EDIT: Oops.. Silly me It works now Quote Link to comment Share on other sites More sharing options...
tehphantom Posted October 7, 2007 Share Posted October 7, 2007 srry for renewing an old post but wen i try to move this dll to my paint.net>effects... it doesnt work... wen i tried to do this tut: viewtopic.php?f=15&t=5505 i also needed the shape3d and when i did save as... for the dll into the file it didnt work either but when i Dl'ed the zip file, and extracted it to that it worked fine.. so iono if this works but can you make a zip file for this? for some reason my effects dont show it =[ 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.