Skip to main content

Fading effect.

3 replies [Last post]
landolini
Offline
Joined: 2007-04-15
Points: 0

How can be obtained the effects as in this applet >>>> ?

http://www.sureshotsoftware.com/webeffects/slideshow/index.html

I've tried with AC composite without results ......

Thanks a lot.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bitshit
Offline
Joined: 2004-04-22
Points: 0

When you have access to the image's pixel data (which you can through a BufferedImage) you could alter the pixel values like this to fade between two:

for(int i=0; i {
for(int j=0; j {
int sc = sourceBuffer[i + j * width];
int dc = destBuffer[i + j * width];
destBuffer[i + j * width] = blendColor(sc, dc, fadeAmount);
}
}

public int blendColor(int c1, int c2)
{
return ((c1 & 0x00fefeff) >> 1) + ((c2 & 0x00fefeff) >> 1);
}

mickleness
Offline
Joined: 2005-07-14
Points: 0

Also, I started a project that might help:

http://transitions.dev.java.net

This has over 50 transitions if you're interested in more than fading. :)

rah003
Offline
Joined: 2004-05-26
Points: 0

> How can be obtained the effects as in this applet >>>> ?
> http://www.sureshotsoftware.com/webeffects/slideshow/index.html
>
> I've tried with AC composite without results ......
>
> Thanks a lot.

Have a look at https://timingframework.dev.java.net You can find what you are looking for in the examples.
Or you can have a look at examples from Filthy Rich Client book at http://filthyrichclients.org/

Jan