pivar
asked on
Fade an image
Hi,
I have an image that I would like to "fade" to white. Maybe fade is not the correct term here. What I would like to do is animate a change of the colors to all white, that is, lessen the color. (Maybe this is not the correct term either. As you can see, I'm not a graphics guy.)
This would be in Android/Java.
Is this possible in code?
/peter
I have an image that I would like to "fade" to white. Maybe fade is not the correct term here. What I would like to do is animate a change of the colors to all white, that is, lessen the color. (Maybe this is not the correct term either. As you can see, I'm not a graphics guy.)
This would be in Android/Java.
Is this possible in code?
/peter
ASKER
I would like to apply this on an image, drawing it to the canvas myself. How would this be implemented with your solution?
thx
thx
why don't you try to put that image inside a layout and then fade that layout instead of that image?
ASKER
Because I want to implement this in a drawing engine which draws various types of imageobject to the same canvas, where the fader object would be one. Because of this I would like to be able to transform the image/Bitmap.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Assuming Android Canvas matches HTML5 Canvas, and you have a 2D context, then its code like this.
context.fillStyle = "white"
context.fillRect (top, left, width, height)
context.globalAlpha = ? // some amount of transparency, 1 = full opaque, 0 = full transparent
context.drawImage (image, top, left, width, height)
The program would change the globalAlpha value from one to zero over a time period.
ASKER
satsumo, would that affect the whole canvas, or just my image that I'm drawing? What is meant by "Android Canvas matches HTML5 Canvas"?
ASKER
Just to confirm that we're on the right track. It is the transparency one should change to get the impression of an image "loosing" its colors?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://stackoverflow.com/questions/4533731/android-fade-effect-between-layouts
please try the same