midora Posted October 15, 2013 Posted October 15, 2013 Regarding the switch to Paint.NET 4 and .NET 4.5. Should we keep the references to the old dlls and stay with .NET 3.5 or is there an advantage to switch to the new dlls which require .NET 4.5? Are there new interfaces or features available? Quote
Rick Brewster Posted October 17, 2013 Posted October 17, 2013 Well, first off there's of course the question of "do you want to retain compatibility with Paint.NET 3.5?" If the answer is yes, you should keep using .NET 3.5 SP1 and make sure to compile using references to the Paint.NET 3.5.x DLLs. There aren't really that many new things for plugins. There is EffectFlags.ForceAliasedSelectionQuality. There is also comprehensive access to Direct2D and DirectWrite, however I'm not yet sure I'm comfortable giving the green light for plugins to use that. However, we're still at alpha so there's a lot of things I'm not yet comfortable with Maybe you can try it out and let me know what you think, and maybe I'll get more comfortable. You can start by using one of the DrawingContext.From_____() methods in the PaintDotNet.Direct2D namespace in PaintDotNet.Core.dll. There is also a greatly simplified resource management system for Direct2D sitting in PaintDotNet.Framework.dll inside of the PaintDotNet.UI.Media namespace. Instead of using IDrawingContext.CreateSolidColorBrush(...) and managing the lifetime (e.g. calling Dispose()) of an ISolidColorBrush, you can instead create a SolidColorBrush (no "I") and the extension methods on IDrawingContext will automatically create and cache the ISolidColorBrush for you. You don't have to destroy your SolidColorBrush (it doesn't really use any resources by itself), although if you want to use it across multiple threads you'll need to Freeze() it. You should wrap your use of DrawingCOntext.From____() in a using block. When the drawing context is created, that corresponds to calling ID2D1RenderTarget :: BeginDraw(), and then disposing the IDrawingContext corresponds to calling ID2D1RenderTarget :: EndDraw(). using (IDrawingContext dc = DrawingContext.FromGraphics(g)) { dc.FillRectangle(...); } Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
midora Posted October 19, 2013 Author Posted October 19, 2013 (edited) Not making pressure, we are happy that you did the step to publish an alpha. And we know the amount of work behind it and to finish it. I would expect there are two or three other new things ;-) Like new PropertyBased controls (Roller). Playing with Direct2D may be fun. So let's keep a copy of the 3.5 libs to be on the save side. BTW: EffectFlags.ForceAliasedSelectionQuality is a small step to Unlimited (IgnoreSelection) flag ;-) Edited October 19, 2013 by midora Quote
BoltBait Posted October 19, 2013 Posted October 19, 2013 BTW: EffectFlags.ForceAliasedSelectionQuality is a small step to Unlimited (IgnoreSelection) flag ;-) THAT will never happen. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
midora Posted October 19, 2013 Author Posted October 19, 2013 THAT will never happen. Never say never ;-) Especially if ... Quote
Rick Brewster Posted October 19, 2013 Posted October 19, 2013 BoltBait's right though, I'm not adding/changing that. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Ego Eram Reputo Posted October 25, 2013 Posted October 25, 2013 I would like to ask a question or two to clarify the plugin situation. 1. Plugins compiled using references to the paint.net 3.5.x dlls will continue to work with 3.5.x (obviously) and also 4.0? 2. Plugins compiled using references to the paint.net 4.0 dlls will work with 4.0 but not 3.5.x? 3. Am I correct to assume CodeLab generates plugins compatible with version(s) under the same reasoning as 1 and 2? I'm trying to spell this out as clearly as possible because there are bound to be numerous questions arising from this. 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
midora Posted October 25, 2013 Author Posted October 25, 2013 1. Plugins compiled using references to the paint.net 3.5.x dlls will continue to work with 3.5.x (obviously) and also 4.0? As long as the plugins do not access methods outside of the somehow specified plugin interface (i.e. Ui. helper methods) . These plugins may break. But this is nothing new. Quote
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.