nesa Posted June 27, 2006 Share Posted June 27, 2006 Is there actually a way to obtain the bounds of the current selection? I just want a rectangle that encloses the selection. If I can't get the information then I'm limited to using the centre of the image (assuming I dont add some fiddly control in the effect dialog to enable the user to adjust the origin)? I thought the dstArgs.Bounds inside the render() method would be this information, but it doesn't appear so. Just wondering if I'm missing something. If not, could this be added sometime maybe? :wink: Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted June 27, 2006 Share Posted June 27, 2006 There should be a way to get at the current slection (EffectEnvironmentParameters, IIRC). And that should have a GetBounds() method. dstArgs.Bounds just retrieves a Rectangle that defines the bounds for the entire output layer. It is always at (0,0) and has the same width and height as the whole image (by definition). 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...
nesa Posted June 27, 2006 Author Share Posted June 27, 2006 Hiya, I did check the EffectEnvironmentParameters and couldn't see much. It seems to provide BackColor, ForeColor and BrushWidth along with a GetSelection method which seemed promising but takes a Rectangle and returns a PdnRegion which doesn't seem quite what I wanted. Although I haven't worked long with this so it could be I'm misunderstanding the method I thought maybe the rectangle could be a subset of the image, allowing you to grab a part of the selection only. But if I pass in dstArgs.Bounds I simply get the surface bounds again. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted June 27, 2006 Share Posted June 27, 2006 Oh, pass dstArgs.Bounds to GetSelection(). It's not thread safe though, from looking at the code. 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...
nesa Posted June 30, 2006 Author Share Posted June 30, 2006 FWIW I tried passing in dstArgs.Bounds and I just seem to get the surface bounds back. :? 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.