midora Posted March 4, 2021 Share Posted March 4, 2021 I spent some time to figure out an easy way to invert a PdnRegion but failed. Assuming there is a selection containing the whole image with a hole in it. How can I get the PdnRegion of the hole? Tried Xor and Exclude but the results are strange. I checked the Bounds of the inverted region. Typically they show x/y=0/0 and width/height=right and bottom of the inverted region. Any ideas? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 5, 2021 Share Posted March 5, 2021 Can you show some code for what you've already tried? Context is important here 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...
midora Posted March 5, 2021 Author Share Posted March 5, 2021 I guess I looked to the wrong bounds method GetBoundsRectInt32(). The basic version GetBounds() returned the expected rectangle of the hole. No idea why GetBoundsRectInt32() returns 0/0 and the right/bottom values in the rectangle. propInvertedSelection = propSelection.Clone(); propInvertedSelection.Xor(EnvironmentParameters.SourceSurface.Bounds); RectangleF invertedBounds = propInvertedSelection.GetBounds(); Now I just have to figure out how to use the PdnRegion as a standard Region without using the RegionScans. 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.