Red ochre Posted June 4, 2012 Share Posted June 4, 2012 Selection2clear [makes the selection transparent, whilst leaving the selection active]Hello all,The problem: I spend ages isolating a complex selection, I delete the selection on one layer, move to the next layer to try to delete the same selection - but the selection is gone!(This doesn't happen with 'fill selection' - only with delete. It caused me problems because I was trying to shape a cloud made up from many layers all interacting via different blending modes. Thought I'd try just changing the top layer and then use 'Alpha mask' on the other layers but Alpha mask didn't work for some reason - maybe due to the layer blend modes or because the transparency of the different layers were not fully opaque?)The soloution: My simplest plugin yet! - select something, click 'selection2clear' (under Effects/selection), problem solved, selection clear but still active so I can now change layers and repeat the action.No UI screen shot as no UI !I'm probably the only person that will use this but if you encounter the same problem here's the .dllAnd here's the code for in-depth study! /* =================================================== */ /* selection to clear*/ /* (c) 2012 Red Ochre */ /* */ /* Description: make selection transparent, plugins maintain the selection, delete doesnt */ /* */ /* ========================================== ======== */ // Name: selection2clear // Author: Red ochre (John Robbins) // Submenu: Transparency // URL: http://www.getpaint.net/redirect/plugins.html // Title: selection2clear June 2012 Red Ochre void Render(Surface dst, Surface src, Rectangle rect) { for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { ColorBgra CurrentPixel = src[x,y]; CurrentPixel.A = 0; // now preserves BGR values as suggested by BoltBait dst[x,y] = CurrentPixel; } } } 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Rick Brewster Posted June 4, 2012 Share Posted June 4, 2012 Why not just use Edit -> Fill Selection with a transparent color? Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Red ochre Posted June 4, 2012 Author Share Posted June 4, 2012 Hi Rick, Yes you can - I think it's easier to just click on one icon and have the selection clear rather than expanding the color window, then changing the primary color - then changing it back again - I did say I would probably be the only person using it! Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
yellowman Posted June 4, 2012 Share Posted June 4, 2012 Good idea Red Ochre, Boltbait plugin Transparency, I use it for same purpose. Quote My GalleryMy YouTube Channel "PDN Tutorials" Link to comment Share on other sites More sharing options...
midora Posted June 5, 2012 Share Posted June 5, 2012 You may use cut and paste to do the trick. 1. Select something in a layer 2. Cut 3. Switch to another layer 4. Paste (this restores the selection) 5. Cut 6. Goto 3. But I would also vote to decouple Delete and Deselect. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted June 6, 2012 Share Posted June 6, 2012 Hi Rick, Yes you can - I think it's easier to just click on one icon and have the selection clear rather than expanding the color window, then changing the primary color - then changing it back again - I did say I would probably be the only person using it! Well then if it's easier for you, why not Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
barbieq25 Posted June 6, 2012 Share Posted June 6, 2012 Well, I never knew of some of the suggestions (except the copy paste, which is what I used to do) but I like the idea of the plugin. I'll give it whirl! Thankies! Quote Knowledge is no burden to carry. April Jones, 2012 Gallery My DA Gallery Link to comment Share on other sites More sharing options...
Red ochre Posted June 6, 2012 Author Share Posted June 6, 2012 @ yellowman - Boltbait's 'Transparency' plugin is always useful - the only slight advantage of this, for this job, is that it is in the effects section rather than adjustments, so if used on multiple layers the icon appears in the top 'apply last effect' section. @ midora - I had'nt thought of doing it that way, clever! @ Rick - I meant no criticism of the default selection behaviour. Just thought I'd share my soloution to this task. As you can see from the code, I didn't waste too much time writing it, and now we have 4 ways to do it. @ barbieq25 - not as much fun (or as complicated) as some of my others I'm afraid, but it does what I wanted. Thanks for saying thanks. Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Red ochre Posted June 9, 2012 Author Share Posted June 9, 2012 ? - no idea what you're on about ? Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
65432123456 Posted June 10, 2012 Share Posted June 10, 2012 ? - no idea what you're on about ? paint net is just middle kids between paintbrush and photoshop............get it? Quote Link to comment Share on other sites More sharing options...
65432123456 Posted June 10, 2012 Share Posted June 10, 2012 after using your plugin, my font is disappear ....can you fix it ...thanks Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 10, 2012 Share Posted June 10, 2012 I don't recommend putting this under the Selection menu. Because it doesn't use the "marching ants" selection path to affect the overall effect. You should put this under "Render > Transparent". Also, your render loop should look like this: ColorBgra CurrentPixel = src[x,y]; CurrentPixel.A=0; dst[x,y]=CurrentPixel; ...this way the color information is retained. Done this way, you can bring back the pixels later using Adjustments > Transparency. Visually, the result is the same. However, this way your effect is more useful. 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...
Red ochre Posted June 10, 2012 Author Share Posted June 10, 2012 Ok - will change to preserve BGR values. Would Effects/transparency be ok.? (Render is very overcrowded, on my set up anyway). Many thanks - I have updated the .dll and the source as suggested. Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted June 10, 2012 Share Posted June 10, 2012 Arguably its an adjustment. Considered the Adjustments menu? 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...
Red ochre Posted June 10, 2012 Author Share Posted June 10, 2012 Hi EER, I wanted it in the effects menu because of the 'repeat last effect' option after using it once. Technically (arguably) 'psychocolour' is an adjustment but it seemed more logical to put that under color Starting to wish I hadn't bothered with this! Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted June 11, 2012 Share Posted June 11, 2012 It's a good learning experience! 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...
Djisves Posted June 13, 2012 Share Posted June 13, 2012 ... I wanted it in the effects menu because of the 'repeat last effect' option after using it once. ... I can smell a feature request just around the corner... "Repeat Last Adjustment", perhaps? I know I'm off-topic but I wanted to comment. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted June 13, 2012 Share Posted June 13, 2012 I've been thinking about that one too. If it's good for the Effects, why not the Adjustments? 1 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...
Peter1 Posted February 17, 2022 Share Posted February 17, 2022 (edited) On 6/4/2012 at 6:00 PM, Red ochre said: Hi Rick, Yes you can - I think it's easier to just click on one icon and have the selection clear rather than expanding the color window, then changing the primary color - then changing it back again - I did say I would probably be the only person using it! wrong thread Edited February 17, 2022 by Peter1 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.