dstrohschein Posted May 11, 2006 Share Posted May 11, 2006 Hi guys, I am modifying the Paint.NET control to see if I can use it for a test project I am building. I have createe a custom control with true transparency (via the ExStyle param change. It's basically a transparent label with a shape drawn on it). I can add this control anywhere on the form I want, and it shows up, even over other controls. However, if I move the control over the DocumentView control, my transparent control is erased (basically any part of the control that is overlapping the documentview control gets wiped out). It's like the DocumentView control is always on the highest z-order, but SendToBack/BringToFront does nothing to change this. If I remove the Transparency ExStyle param, the control will show up properly. I can not figure out why I can't lay my transparent control over the DocumentView control. Does anyone have any ideas on what the deal is here? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted May 11, 2006 Share Posted May 11, 2006 No idea. DocumentView was never designed to accomodate a scenario like this. 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...
dstrohschein Posted May 12, 2006 Author Share Posted May 12, 2006 Of course when I say DocumentView I mean the DocumentView/SurfaceBox/PanelEx combination that makes up the workspace environment drawing canvas I figured it probably wasn't designed this way, but I thought it would work- What I guess I don't understand is this: 1. the document view control paints itself 2. my control paints itself over a portion of the document view 3. document view RE-paints itself. Is there something that tells the DocumentView/SurfaceBox/PanelEx combination to invalidate when something is drawn over it? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted May 12, 2006 Share Posted May 12, 2006 You might try implementing a SurfaceBoxGraphicsRenderer instead, and adding that to the Renderers. 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...
dstrohschein Posted May 12, 2006 Author Share Posted May 12, 2006 Forgive my ignorance, but are you saying that I should implement a SurfaceBoxGraphicsRenderer as opposed to a DocumentView? Or as Opposed to my transparent control? Thanks for your time Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted May 12, 2006 Share Posted May 12, 2006 If you want to draw "on" a DocumentView, implement a SurfaceBoxGraphicsRenderer. The SurfaceBox has a list of SurfaceBoxRenderers that it uses to render on to its double buffer surface. SurfaceBoxGraphicsRenderer derives from that class and DocumentView recognizes instances of it and allows them to draw outside the canvas area using standard GDI+. 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...
dstrohschein Posted May 12, 2006 Author Share Posted May 12, 2006 Great! This is awesome, thank you for your help with this. Thank you for all your hard work and such a great educational experience! 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.