pyrochild Posted April 15, 2008 Share Posted April 15, 2008 System.InvalidOperationException: Alpha value must be 255 for this to work at PaintDotNet.ColorBgra.ToOpaqueInt32(ColorBgra color) Seems silly to me. Doesn't the name imply that int32 returned will be of the opaque version of the input color? It doesn't make sense that it should require an already-opaque color. Maybe I'm just being naive... 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...
Rick Brewster Posted April 15, 2008 Share Posted April 15, 2008 The To/From Opaque functions were really only added for use with the IndirectUI color wheel control. The reason it requires an alpha value of 255 is because that is the only unambiguous case for conversion. If alpha is 128, then there are different methods of transforming the R,G,B values ... do you pre-multiply or not, etc.? The end result is an opaque color but may not be the one that was desired. By requiring A=255, there is simply no ambiguity. If you need a different conversion method, it is easy enough to implement it yourself. 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...
pyrochild Posted April 15, 2008 Author Share Posted April 15, 2008 Ohhhhhhh. 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...
Rick Brewster Posted April 16, 2008 Share Posted April 16, 2008 See, c'mon man, there's usually a method to my madness :twisted: 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...
pyrochild Posted April 16, 2008 Author Share Posted April 16, 2008 Normally I wouldn't have even bothered with a post about it; I'd just have written my own implementation and that would be that. In this case, though, I made a bad assumption, implemented it, didn't bother testing, and managed to have Ash make it crash DOH! See, c'mon man, there's usually a method to my madness :twisted: ...usually... 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...
david.atwell Posted April 16, 2008 Share Posted April 16, 2008 Moved to Effects API. Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
pyrochild Posted April 16, 2008 Author Share Posted April 16, 2008 It was a bug report! 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...
david.atwell Posted April 16, 2008 Share Posted April 16, 2008 But it isn't anymore! That's why I didn't chide you. :-) EDIT: You done with this? Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
pyrochild Posted April 16, 2008 Author Share Posted April 16, 2008 EDIT: You done with this? No, I'd like to keep pestering you for a while, if you don't mind. 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...
david.atwell Posted April 16, 2008 Share Posted April 16, 2008 Please, pester on! Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. 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.