This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash General > November 2005 > IViewObject and alpha channel





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author IViewObject and alpha channel
JM Courivaud

2005-11-12, 6:15 pm

When using IViewObject::Draw method, Flash player 8 seems to completely
remove the alpha channel information...
Moreover it seems like the result is pre-multiplied again some kind of
background (basically the one already existing in the HDC)
....
Why did the alpha channel information disappeared?
It is fairly inconvenient because now if I want to display a flash anim on a
background I will need to draw it on 2 different background and then try to
retrieve color and alpha... I did not test and I'm not sure it will work but
what I'm sure is that performance won't be good...

Is there another work around for this?





Jeckyl

2005-11-12, 6:15 pm

This very issue was replied to by a MM persons several weeks ago . .you can
probably find it if you search the forums (not sure which flash forum it was
in) for IViewObject .. eg

http://groups.google.com.au/group/m...bc9e178309f9ab3

--
Jeckyl


JM Courivaud

2005-11-13, 6:15 am

Hello,

Thanks for the link.
I read the explanations and I more or less understand .

Basically the flash player compose the image with whatever is already in the
DC when calling IViewObject::Draw.
(but apparently reseting the alpha to 100% on the DC before doing so).
Thus whatever is quite transparent in the Flash movie appears nearly black
(transparent in flash + black in the DC since it is generally initialized
with 0).
The main problem (from my point of view) is that Flash don't keep the alpha
layers and automatically set all alpha for each pixel to FF.
So even knowing the background we cannot retrieve the proper information
(original color and original alpha).
The only thing possible is to try by calling Draw on 2 different background
and then trying to retrieve this.

I think one possibility would be to still have flash working this way but
properly setting the alpha byte to whatever is the case in flash.
then (knowing the bavkground) it would be possible to get back the original
flash pixels with alpha and blit it against another background.



"Jeckyl" <jeckyl@hyde.com> a écrit dans le message de news:
GNsdf.15894$Hj2.14322@news-server.bigpond.net.au...
> This very issue was replied to by a MM persons several weeks ago . .you
> can probably find it if you search the forums (not sure which flash forum
> it was in) for IViewObject .. eg
>
> http://groups.google.com.au/group/m...bc9e178309f9ab3
>
> --
> Jeckyl
>



JM Courivaud

2005-11-13, 6:15 am

Hi :-)

calling Draw on white and then on black bakground allow one to retrieve the
alpha and get things working again.
(apparently with not too bad performances)
blending though doesn't find it's way :-)
(which is understandable)





"JM Courivaud" <jeanmichel.courivaud@noos.fr> a écrit dans le message de
news: 43770719$0$4816$79c14f64@nan-newsreader-06.noos.net...
> Hello,
>
> Thanks for the link.
> I read the explanations and I more or less understand .
>
> Basically the flash player compose the image with whatever is already in
> the DC when calling IViewObject::Draw.
> (but apparently reseting the alpha to 100% on the DC before doing so).
> Thus whatever is quite transparent in the Flash movie appears nearly black
> (transparent in flash + black in the DC since it is generally initialized
> with 0).
> The main problem (from my point of view) is that Flash don't keep the
> alpha layers and automatically set all alpha for each pixel to FF.
> So even knowing the background we cannot retrieve the proper information
> (original color and original alpha).
> The only thing possible is to try by calling Draw on 2 different
> background and then trying to retrieve this.
>
> I think one possibility would be to still have flash working this way but
> properly setting the alpha byte to whatever is the case in flash.
> then (knowing the bavkground) it would be possible to get back the
> original flash pixels with alpha and blit it against another background.
>
>
>
> "Jeckyl" <jeckyl@hyde.com> a écrit dans le message de news:
> GNsdf.15894$Hj2.14322@news-server.bigpond.net.au...
>
>



Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews