Toli Posted November 5, 2007 Share Posted November 5, 2007 It is straightforward to get the Selection and its Bounding Rectangle in the Effect.Render(...) Method. However, I need it way before the Render Method executes, i.e. in the Effect Constructor, because I want to make use of it in the Effect UI (to disable some Controls if the Selection is not Rectangular, not Square and so on). Please try to help me. Quote Link to comment Share on other sites More sharing options...
Stephan Posted November 5, 2007 Share Posted November 5, 2007 Technically, the selection isn't a separate picture in which everything is rendered, but just what would happen if you'd render the effect over the whole picture (layer), and then cut out the piece that is selected. (This can be avoided by placing elements on different layers.) Example: As you see, on the left, there is black blur too, although the black wasn't selected. In the current infrastructure, it doesn't work at all to seclude an area in your plugin. I hope this answered your question. Quote Link to comment Share on other sites More sharing options...
Toli Posted November 5, 2007 Author Share Posted November 5, 2007 Sorry, that was not what I wanted. Thank you anyway. I just wanted to find out, for example, if: 1. Is anything selected? 2. Is the selection Freeform / Rectangle / Square? Quote Link to comment Share on other sites More sharing options...
pyrochild Posted November 5, 2007 Share Posted November 5, 2007 This really should be in "Effects API / Programming" Anyway, you can't have access to the Selection as early as you want, but you DO have access to it in time for the EffectConfigDialog's initialization, and can update your controls then. It's in the EffectConfigDialog class as Selection PdnRegion EffectConfigDialog.Selection; (base.Selection from your dialog) 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...
Toli Posted November 5, 2007 Author Share Posted November 5, 2007 Thank you very much. I did not know about the Effects API forum. I will post related questions there from now on. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted November 5, 2007 Share Posted November 5, 2007 I did not know about the Effects API forum. I will post related questions there from now on. That isn't really an excuse. A simple glance through the sections on the front forum page would have made this apparent. 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...
Rick Brewster Posted November 5, 2007 Share Posted November 5, 2007 In 3.20 you will have access to the selection in your OnSetRenderInfo() virtual method, via the environment parameters object. This method is called once for every time the token changes, and rendering does not proceed until it returns control to the caller. This is how some of the new UI gets ahold of the source surface so it can add the image underlay as seen here: http://blog.getpaint.net/2007/10/21/mor ... s-of-news/ 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...
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.