Simon Brown Posted November 25, 2007 Share Posted November 25, 2007 How can I call another effect with prameters the way that is compatible with paint.net 3.20? Quote Link to comment Share on other sites More sharing options...
pyrochild Posted November 25, 2007 Share Posted November 25, 2007 AddNoiseEffect ane; PropertyCollection aneProps; PropertyBasedEffectConfigToken aneToken; ane = new AddNoiseEffect(); aneProps = ane.CreatePropertyCollection(); aneToken = new PropertyBasedEffectConfigToken(aneProps); aneToken.SetPropertyValue(AddNoiseEffect.PropertyNames.Intensity, 40); aneToken.SetPropertyValue(AddNoiseEffect.PropertyNames.Saturation, 0); aneToken.SetPropertyValue(AddNoiseEffect.PropertyNames.Coverage, 100); //This line is not necessary, really, because 100 is the default... ane.SetRenderInfo(aneToken, dstArgs, srcArgs); ane.OnRender(rois, startIndex, length); Is the general gist of it. Obviously, you need to separate some of those lines into their appropriate methods... 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...
Simon Brown Posted November 25, 2007 Author Share Posted November 25, 2007 AddNoiseEffect ane; PropertyCollection aneProps; PropertyBasedEffectConfigToken aneToken; ane = new AddNoiseEffect(); aneProps = ane.CreatePropertyCollection(); aneToken = new PropertyBasedEffectConfigToken(aneProps); aneToken.SetPropertyValue(AddNoiseEffect.PropertyNames.Intensity, 40); aneToken.SetPropertyValue(AddNoiseEffect.PropertyNames.Saturation, 0); aneToken.SetPropertyValue(AddNoiseEffect.PropertyNames.Coverage, 100); //This line is not necessary, really, because 100 is the default... ane.SetRenderInfo(aneToken, dstArgs, srcArgs); ane.OnRender(rois, startIndex, length); Is the general gist of it. Obviously, you need to separate some of those lines into their appropriate methods... Thanks But I do wander why they changed it. Quote Link to comment Share on other sites More sharing options...
pyrochild Posted November 25, 2007 Share Posted November 25, 2007 The new property-based system is much faster to write new effects for. And more powerrrrful. 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...
Simon Brown Posted November 25, 2007 Author Share Posted November 25, 2007 The new property-based system is much faster to write new effects for. And more powerrrrful. But it's a shame they didn't make it backwards compatible. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted November 25, 2007 Share Posted November 25, 2007 Why would I make it backward compatible? This new method is far better, and allows strong typing at compile time as well as runtime discoverability of an effect's inputs and constraints. "Backwards compatible" just entails having a bunch of compatibility props with [Obsolete] on them so that old plugins can still work. There's only 1 effect that warranted that, which was BlurEffect. 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.