Re: [flexcoders] Re: Transparent=true on BitmapData not working
Just plain old 0 worked fine. I just went back and checked the docs, they do actually tell you to do that, but I doubt I ever would have seen it. Doesn't really make sense, but you get that :) -J On Feb 20, 2008 5:02 PM, Shannon [EMAIL PROTECTED] wrote: try 0x0100, im not sure what other way to tell flash you aren't trying to say 0x00 (which is also zero) --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Doug McCune [EMAIL PROTECTED] wrote: add in a fill color for the initial BitmapData that is a full argb hex string. If you don't do this the transparency won't work as far as I know. So try changing the line to: var bmd : BitmapData = new BitmapData(dragInitiator.width, dragInitiator.height, true, 0x); Doug On 2/19/08, Josh McDonald [EMAIL PROTECTED] wrote: Hi guys, I can't seem to get transparent=false to work when creating a BitmapData. I'm using it as a dragproxy, and I get a white box instead of nothing when I do the following: var bmd : BitmapData = new BitmapData (dragInitiator.width, dragInitiator.height, true); //bmd.draw(dragInitiator); dragProxy.graphics.beginBitmapFill(bmd); dragProxy.graphics.drawRect(0, 0, dragProxy.width, dragProxy.height); if I uncomment the bmd.draw() line everything goes according to plan, but the dragInitiator component has rounded edges so I can see 4 little white corners, which is definitely not the way I'd like it to work. Any ideas? -J -- Therefore, send not to know For whom the bell tolls, It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls, It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
Re: [flexcoders] Re: Transparent=true on BitmapData not working
Just plain old 0 worked fine. I just went back and checked the docs, they do actually tell you to do that, but I doubt I ever would have seen it. Doesn't really make sense, but you get that :) Actually, it makes perfect sense. The default value for the fill color is 100% white with 100% alpha (fully opaque), which is 0x in ARGB format. You want it to be blank/transparent, so you need to provide a default fill color that has 0% alpha, so anything of the form 0x00??. Using black with zero-alpha is good habit because it's equivalent to pre-multiplying your colors with black, which is what works best (or at least most intuitively) with standard computer blending equations. The true/false flag just controls whether or not your BitmapData *has* an alpha channel, not what the contents of that alpha channel are (the docs should probably be clearer about this and the argument should probably be named hasAlphaChannel as opposed to transparency, just to be more explicit). Basically, this flag controls whether your data is ARGB or RGB (though I wouldn't be surprised if they were both stored as 32-bits-per-pixel as that normally speeds up blitting since the pixels are word-aligned). Troy.
Re: [flexcoders] Re: Transparent=true on BitmapData not working
So the colour value is a 32 bi argb instead of just 24 bit rgb then? Well that makes sense :) Where else in flex is a colour value 32 bit instead of 24 bit? Is it all over the place and I've just never noticed? What about in styles? -J On Thu, Feb 21, 2008 at 3:39 AM, Troy Gilbert [EMAIL PROTECTED] wrote: Just plain old 0 worked fine. I just went back and checked the docs, they do actually tell you to do that, but I doubt I ever would have seen it. Doesn't really make sense, but you get that :) Actually, it makes perfect sense. The default value for the fill color is 100% white with 100% alpha (fully opaque), which is 0x in ARGB format. You want it to be blank/transparent, so you need to provide a default fill color that has 0% alpha, so anything of the form 0x00??. Using black with zero-alpha is good habit because it's equivalent to pre-multiplying your colors with black, which is what works best (or at least most intuitively) with standard computer blending equations. The true/false flag just controls whether or not your BitmapData *has* an alpha channel, not what the contents of that alpha channel are (the docs should probably be clearer about this and the argument should probably be named hasAlphaChannel as opposed to transparency, just to be more explicit). Basically, this flag controls whether your data is ARGB or RGB (though I wouldn't be surprised if they were both stored as 32-bits-per-pixel as that normally speeds up blitting since the pixels are word-aligned). Troy. -- Therefore, send not to know For whom the bell tolls, It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Re: Transparent=true on BitmapData not working
Only in bitmapdata From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Wednesday, February 20, 2008 11:46 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Transparent=true on BitmapData not working So the colour value is a 32 bi argb instead of just 24 bit rgb then? Well that makes sense :) Where else in flex is a colour value 32 bit instead of 24 bit? Is it all over the place and I've just never noticed? What about in styles? -J On Thu, Feb 21, 2008 at 3:39 AM, Troy Gilbert [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Just plain old 0 worked fine. I just went back and checked the docs, they do actually tell you to do that, but I doubt I ever would have seen it. Doesn't really make sense, but you get that :) Actually, it makes perfect sense. The default value for the fill color is 100% white with 100% alpha (fully opaque), which is 0x in ARGB format. You want it to be blank/transparent, so you need to provide a default fill color that has 0% alpha, so anything of the form 0x00??. Using black with zero-alpha is good habit because it's equivalent to pre-multiplying your colors with black, which is what works best (or at least most intuitively) with standard computer blending equations. The true/false flag just controls whether or not your BitmapData *has* an alpha channel, not what the contents of that alpha channel are (the docs should probably be clearer about this and the argument should probably be named hasAlphaChannel as opposed to transparency, just to be more explicit). Basically, this flag controls whether your data is ARGB or RGB (though I wouldn't be surprised if they were both stored as 32-bits-per-pixel as that normally speeds up blitting since the pixels are word-aligned). Troy. -- Therefore, send not to know For whom the bell tolls, It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
[flexcoders] Re: Transparent=true on BitmapData not working
try 0x0100, im not sure what other way to tell flash you aren't trying to say 0x00 (which is also zero) --- In flexcoders@yahoogroups.com, Doug McCune [EMAIL PROTECTED] wrote: add in a fill color for the initial BitmapData that is a full argb hex string. If you don't do this the transparency won't work as far as I know. So try changing the line to: var bmd : BitmapData = new BitmapData(dragInitiator.width, dragInitiator.height, true, 0x); Doug On 2/19/08, Josh McDonald [EMAIL PROTECTED] wrote: Hi guys, I can't seem to get transparent=false to work when creating a BitmapData. I'm using it as a dragproxy, and I get a white box instead of nothing when I do the following: var bmd : BitmapData = new BitmapData (dragInitiator.width, dragInitiator.height, true); //bmd.draw(dragInitiator); dragProxy.graphics.beginBitmapFill(bmd); dragProxy.graphics.drawRect(0, 0, dragProxy.width, dragProxy.height); if I uncomment the bmd.draw() line everything goes according to plan, but the dragInitiator component has rounded edges so I can see 4 little white corners, which is definitely not the way I'd like it to work. Any ideas? -J -- Therefore, send not to know For whom the bell tolls, It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]