Make images fade in & out?

Hi, we're redeveloping our application in swing (java 1.4.2).
When the application is not in use it displays several images on the screen. We want these to smoothly fade in and out (not necessarily synchronised with each other) so as to be more visually appealing.
Any recommendations on a good technique?
We don't want to use animated gifs due to the 256-colour limit - is there a way to do this that isn't CPU-intensive? Something we can use with PNGs, for example?
TIA
Phil

well perhaps you can override the paint method, which will change the opacity of the image...and maybe use some type of thread or timer to animate that fade in/out affect. Set change the opacity used by the Graphics2D object in a paint method do the following:
     * Set alpha composite.  For example, pass in 1.0f to have 100% opacity
     *  pass in 0.25f to have 25% opacity.
    private AlphaComposite makeComposite(float alpha) {
        int type = AlphaComposite.SRC_OVER;
        return (AlphaComposite.getInstance(type, alpha));
     public void paint(Graphics g) {
              Graphics2D g2d = (Graphics2D) g;
              g2d.setComposite(makeComposite(.25f));
              // do some painting...
      }that should give you some idea.
good luck!

Similar Messages

  • How to make images fade in and out

    how to make images fade in and out continuously

    HI,
    The Ken Burns effects can do this nicely. Available in the iLife suite of software.
    iLife 06 minimum requirements:
    http://support.apple.com/kb/HT2675
    iLife 06 - Amazon
    Carolyn

  • How do i make images fade into each other

    Hey guys,
    I'm looking to find out how I can make text and/or images fade and appear on my web page. This affect is used on the adobe home page where text fades and other text appears.
    If someone could point me in the right direction that would be great. I think  need to know flash. but any advice would be appreciated. Thanks

    jQuery
    http://www.geeksucks.com/toolbox/23-jquery-fade-in-fade-out-effect.htm
    jQuery Cycle Plug-in might do what you need
    http://malsup.com/jquery/cycle/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Help with image fade in/out

    I have not used Flash for almost 10 years and things have changed. I have 20 photographs that I would like to set up and have fade in and out, but can find no help on how this is done. So many options have been added to the Flash program that I am lost. I din't think it would be that big of a deal.Could I get some help on how this is done? All images are the same size and I just want to have the first appear for a few seconds and then fade out while the next fades in. Then have the second stay up for a few seconds and then fade out while the 3rd fades in... It really isn't that big of a deal, I'm just lost on getting started.
    Also, how can I create a background that will stay the same throughout the flash?
    Thanks

    Hi there,
    I wrote simple code showing and hiding MovieClips called "pic1", "pic2"...
    I used no classes, everything's on timeline frame, so it's as basic as it can be. I hope you know how to reference to children of MovieClips and such, coz probably you won't want to have everything on main timeline. So, what you need to have this code working is put each picture to its MovieClip and set them on the stage and set their instance names. Don't set their alpha or anything, code will do it.
    As I said, it's very basic. Usually it should be done dynamicly from library or even external files, but I think it could cause some trouble for you, and that's not what we want.
    Edit: "var timer:Timer = new Timer(3000);" - Here the 3000 number means 3sec from fade to fade, so when fade time is 1sec, a picture is fully visible for 2sec.
    Edit2: for 18 pictures it's gonna be 18 MovieClips in the library so it's a mess, so if you think you can handle more complex AS, just say.
    Pasting code:
    const FADE_TIME:Number = 1;
    const FRAME_RATE:int = 30;
    const PIC_NUM:int = 2;
    var _actPic:int = 1;
    var _alphaPerFrame:Number;
    var timer:Timer = new Timer(3000);
    timer.addEventListener(TimerEvent.TIMER, handle_timer);
    _alphaPerFrame = 1 / (FRAME_RATE * FADE_TIME);
    // hide all pictures
    for (var i:int = 1; i <= PIC_NUM; i ++)
        this["pic"+ i].visible = false;
    showPic(1);
    timer.start();
    function hidePic(num_:int):void
        this["pic"+ num_].addEventListener(Event.ENTER_FRAME, handle_showPicEnterFrame);
    function showPic(num_:int):void
        this["pic"+ num_].alpha = 0;
        this["pic"+ num_].visible = true;
        this["pic"+ num_].addEventListener(Event.ENTER_FRAME, handle_showPicEnterFrame);
    * handler of every frame to hide a picture
    function handle_hidePicEnterFrame(e:Event):void
        var a:Number = e.target.alpha - _alphaPerFrame;
        if (a < 0)
            a = 0;
        e.target.alpha = a;
        if (a == 0)
            e.target.visible = false;
            e.target.removeEventListener(Event.ENTER_FRAME, handle_hidePicEnterFrame);
    * handler of every frame to show a picture
    function handle_showPicEnterFrame(e:Event):void
        var a:Number = e.target.alpha + _alphaPerFrame;
        if (a > 1)
            a = 1;
        e.target.alpha = a;
        if (a == 1)
            e.target.removeEventListener(Event.ENTER_FRAME, handle_showPicEnterFrame);
    * handler of every timer tick
    function handle_timer(e:TimerEvent):void
        setChildIndex(this["pic"+ _actPic], 0);
        hidePic(_actPic);
        _actPic ++;
        if (_actPic > PIC_NUM)
            _actPic = 1;
        showPic(_actPic);

  • How to fade in/out multiple images before image faded

    Hi all,
    I plan to do multiple images fade in/out using UIImageView just like Flicker iphone app.
    Here are the steps:
    1. Load pic1.
    2. pic1 move from left to right.
    3. pic1 will slowly turn to become transparent while still moving.
    4. Same time pic2 is moving from right to left.
    I am managed to have the pic1 slowly fading out after it stop moving and pic2 move in at the same time. However what i want is to have the pic1 slowly fading out while it is still moving.
    Can anybody help me to look at my code below: Thanks.
    - (void)viewDidLoad {
    [super viewDidLoad];
    CGPoint newLeftCenter = CGPointMake(180, 240);
    [UIView beginAnimations:@"move1" context:NULL];
    [UIView setAnimationDuration:6.0f];
    [UIView setAnimationCurve:UIViewAnimationTransitionFlipFromRight];
    [UIView setAnimationBeginsFromCurrentState:YES];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(movingStop:finished:context:)];
    pic1.center = newLeftCenter;
    [UIView commitAnimations];
    - (void)movingStop:(NSString*)animationID finished:(BOOL)finished context:(void *)context {
    if ( [animationID isEqualToString:@"move1"] ) {
    CGPoint newLeftCenter = CGPointMake(200, 260);
    [UIView setAnimationBeginsFromCurrentState:YES];
    [UIView setAnimationCurve:UIViewAnimationTransitionFlipFromLeft];
    [UIView setAnimationDuration:3.0];
    pic2.alpha = 1.0;
    pic2.center = newLeftCenter;
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:selector(movingStop:finished:context:)];
    [UIView commitAnimations];
    }

    Hi Teeming, and welcome to the Dev. Forum!
    teeming wrote:
    1. Load pic1.
    2. pic1 move from left to right.
    3. pic1 will slowly turn to become transparent while still moving.
    4. Same time pic2 is moving from right to left.
    I am managed to have the pic1 slowly fading out after it stop moving and pic2 move in at the same time. However what i want is to have the pic1 slowly fading out while it is still moving.
    I'd need to write a test bed to get this right for you, but as a first approximation, I think you'll want to do something like this:
    - (void)viewDidLoad {
    [super viewDidLoad];
    // assume pic1 is now visible at its left starting position at full alpha
    // and pic2 is at it's starting position to the right, either on or off screen
    [UIView beginAnimations:@"move1" context:NULL];
    [UIView setAnimationDuration:6.0f];
    // --> this isn't an animation curve; just use the default for now:
    // [UIView setAnimationCurve:UIViewAnimationTransitionFlipFromRight];
    // --> leave this out for now:
    // [UIView setAnimationBeginsFromCurrentState:YES];
    // --> doesn't look like you need a stop method so leave these out for now:
    // [UIView setAnimationDelegate:self];
    // [UIView setAnimationDidStopSelector:@selector(movingStop:finished:context:)];
    pic1.center = CGPointMake(180, 240);
    pic1.alpha = 0.0;
    pic2.center = CGPointMake(200, 260);
    // I don't think you said whether pic2 is fading in, but if so, add this line as well:
    pic2.alpha = 1.0;
    [UIView commitAnimations];
    Again, the above is only an outline, not working code. If you need more help I might have time to make it work this evening, ok?
    - Ray

  • Adobe Audition CC 2014 - Fade In/Out to playhead?

    Hello all,
    My question is this: In a multitrack session (or in waveform editor) I want to be able to tell Audition to fade in/out to the playhead. At present, I can set a shortcut to "Clip--Fade In(Out) Normal". However, when I use said shortcut in a multitrack session Audition makes a fade in/out of a predetermined length (appx 16 sec). If anyone knows how to adjust this please let me know, otherwise let this thread stand as a feature request.
    Thanks.

    I think you misunderstand the question. I know how to draw a volume envelope. Here's what I want to do:
    Right now to use the automatic fades that are present on each clip I have to grab the box and draw it out. Now, as I said before, there are keyboard shortcuts that will activate this without having to draw it out. I have done this by going to the keyboard shortcut editor, finding "Clip--Fade In (or Out) Normal" and assigning Alt-G to it. If I use my assigned shortcut now it makes a fade that seems to be set at random, probably in relation to the overall length of the selected clip (longer clip=longer fade). What I would like it to do is exampled by the pic above, simply give me a fade in/out in relation to where the playhead is on the selected clip. This would be similar if one was in ProTools (with a-z mode) and types "D" (Fade from start) or "G" (Fade to end). If this option isn't available it should be on a future release.

  • How can I make a fade out effect at the end of the song in garageband for iPad?

    I want to made this effect but honestly I have no idea about what I have to do. u.u Please help.

    ClaudioWalrus wrote:
    How can I make a fade out effect at the end of the song in garageband for iPad?
    GB for iPad doesn't have volume automation, you'd need to import the project into GB on a Mac to create the fade with a volume curve.
    as an alt, finish your song and export the audio file, then import the audio file in an audio editor and create a volume fade with that:
    http://www.bulletsandbones.com/GB/GBFAQ.html#audioeditors
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How to make movieclip controlled by button fade in/out on mouse over/out?

    Hi,
    I am new to Flash, and have tried searching numerous forums to the answer to this question, but nothing I try seems to work. Basically I am trying to create a single "Image" that triggers different animations when you mouse over different invisible buttons located on specific areas. The technique I am using is basically spacing out the animations over different frames, and using the gotoAndPlay command specifying the where the relevant animation is located.
    Here is the code from my actions layer with two animations:
    stop(); /*This ensures no animations are playing on the first frame*/
    /*Mouse over event for redbutton1*/
    redbutton1.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverToGoToAndPlayFromFrame_2);
    function fl_MouseOverToGoToAndPlayFromFrame_2(event:MouseEvent):void
         gotoAndPlay(2); /*This is the frame where the animaton triggered by redbutton1 is located*/
    /* Mouse Out Event for redbutton1*/
    redbutton1.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_3);
    function fl_MouseOutHandler_3(event:MouseEvent):void
         gotoAndPlay(1) /*takes animation back to the start of timeline where it stops*/
    /*Mouse over event for bluebutton1*/
    bluebutton1.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverToGoToAndPlayFromFrame_2);
    function fl_MouseOverToGoToAndPlayFromFrame_2(event:MouseEvent):void
         gotoAndPlay(30); /*This is the frame where the animaton triggered by bluebutton1 is located*/
    /* Mouse Out Event for bluebutton1*/
    bluebutton1.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_3);
    function fl_MouseOutHandler_3(event:MouseEvent):void
         gotoAndPlay(1) /*takes animation back to the start of timeline where it stops*/
    Now basically all I need is some code that means that instead of abruptly starting and stopping the animation, the animation will fade in/out whenever the mouseover/out events are triggered. Note: the animation doesn't have to finish, it basically only plays while the mouse is over.
    Any help would be greatly appreciated.

    It will help oif you show the code for the code-based tweening.  The basics of getting it working with the MOUSE_OVER/OUR commands is fairly straightforward. 
    You have listeners for both events, and the handlers for each listener is where you activate the tweens.  For more seamless functionality it is usually a good idea to have the starting point of the tween be the point where the object currently is (its x or y (or both) propertiy) instead of a fixed value.

  • How do you fade images in and out?

    Okay I know you use alpha to fade images in and out,but how?
    I want to fade oneimage in and then fade it out, then fade another
    one in rightafter it. How do I do this?

    hi,
    first frame - alpha 100
    last frame or anyother frame - alpha0
    between those frames, create a motion tween.
    it will fade as the movie plays. you have to implement it
    according to your needs.
    hope it helps,
    gaurav

  • Text fade in/out won't work if a light makes shadows

    I found that text won't actually use a fade in/out behavior if you are using a light that projects shadows.
    Now, that's an interesting thing. I used to notice with drop-shadows in Mo3, the shadow would show up and the fade would be sort of weird since you could see the shadow under while it faded in. It wasn't a very pretty fade since it got dark and muddy first.
    So, now, it just won't let you do it.
    Bug or user error?

    Adjusting the opacity of a text layer forces it's rasterization. This essentially gives it the properties of a 2D layer which aren't affected by lights.
    In order for you to get a cast shadow AND a fade in/out, you must first flatten the text layer. This can be done by selecting the Flatten button in the Text tab of the inspector. Or else you can drop the text into a 3D group and flatten the group from the Group tab.
    Andy

  • How to make images slideshow that has zoom in/out transition

    Hi people,
    I have around 30 images that I want to do a slideshow, whereby I show the images one by one, formed a circle, after showing all the images, it zooms out to show a logo.
    Any suggestion or tutorial for me? I am very sorry for troubling. This is my 1st time of using Adobe Premiere Pro CS4.
    Thanks and Regards,

    Welcome to the forum.
    As Stanley points out, it appears that you are doing two things: PiP to start, and then animating via Keyframes for the fixed Effects>Motion>Scale, and probably Motion>Position. The "revealing" of the logo can be done by Keyframing various Effects, such as the fixed Effect>Opacity, or perhaps Keyframing an added Effect, such as Blur/Gaussian Blur.
    Reading on both "Picture in Picture," and then "Keyframes" will be a great starting point. The concept of Keyframes is a bit abstract at first, but once you get that concept, you will find it so very useful for many things, so the study time will pay big dividends. Most Effects can be Keyframed directly, and a few more, indirectly. Various different Effects can be Keyframed separately, so that many things can happen over time, in a coordinated "dance." The uses and applications are virtually limitless, and provide so much power, plus aesthetic choices.
    Good luck, and I would start with Stanley's links, and do as much reading, and exprimenting, as is possible. One great resource is the Adobe Classroom in a Book Premiere CS5, Adobe Press. The author covers Keyframing Effects in great detail, plus PiP. Remember, once you understand Keyframes, you will use them constantly, even for adjusting Audio Volume over time.
    Good luck,
    Hunt

  • Help with Image fades

    Hi,
    Haven't used Flash in a couple of years now, and it has
    changed a lot...so I am a bit behind with the times. I need to do a
    site with a each section of the website having a background, that
    fades in when the user goes there. I want the transition from
    section to another to be smooth, and the new background image fade
    in on top as the other fades out (at the same time!)
    Also how do i make some of the links on my website HTML pages
    and some flash? I need to be able to link back to the flash section
    of a site when clicking on the flash section. I found an example on
    the Louis Vuitton site, if you click on your account or newsletter
    and then click back to the Services it will go back to that
    specific section of the flash site.
    http://www.louisvuitton.com
    - check it out to see what I mean.
    Hope you can help, I want to start developing my flash skills
    again.
    Thanks

    Hi,
    Haven't used Flash in a couple of years now, and it has
    changed a lot...so I am a bit behind with the times. I need to do a
    site with a each section of the website having a background, that
    fades in when the user goes there. I want the transition from
    section to another to be smooth, and the new background image fade
    in on top as the other fades out (at the same time!)
    Also how do i make some of the links on my website HTML pages
    and some flash? I need to be able to link back to the flash section
    of a site when clicking on the flash section. I found an example on
    the Louis Vuitton site, if you click on your account or newsletter
    and then click back to the Services it will go back to that
    specific section of the flash site.
    http://www.louisvuitton.com
    - check it out to see what I mean.
    Hope you can help, I want to start developing my flash skills
    again.
    Thanks

  • My MacBook Pro gets really hot when I open a video file of any kind and the video starts lagging and the image fades away, also with anything that starts the fan. Is extremely hot on the left upper corner. Is there something I can do about it?

    My MacBook Pro gets really hot when I open a video file of any kind and the video starts lagging and the image fades away, also with anything that starts the fan. Is extremely hot on the left upper corner. Is there something I can do about it?

    You are still under warranty.  Call Apple Care. Make sure you get a case number as all repairs have an additional 90 days of warranty. 
    #1 - You have 14 days from the date of purchase to return your computer with no questions asked.
    #2 - You have 90 days of FREE phone tech support.
    #3 - You have the standard one year Apple warranty.
    #4 - If you've purchased an AppleCare Protection Plan, your warranty last for 3 years.   You can obtain AppleCare anytime up to the first year of the purchase of your computer.
    Take FULL advantage of your warranty.  Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired.

  • How can I create a scrolling effect where when the user scrolls down the image will blur out?

    How can I create a scrolling effect where when the user scrolls down the image will blur out?

    Hi there,
    You can create a scroll motion where the image will fade out on scrolling, you need to use the Opacity tab under Scroll Effects Panel.
    If you particularly need the image to be blur out, then you need to edit that image in any image editing program and make one copy of that image as blurred, then place both images (actual and blurred) on that page and use scroll motion or fade option to replace images.

  • Rotating images fade-in

    i managed to create a rotating image banner with the help from this website
    http://www.communitymx.com/content/article.cfm?cid=651FF
    but without the fade-in fade-out effect it doesn't look very nice. how can i make the images fade-in like in the below website
    http://www.flipflopflo.co.uk/home
    i found some help here
    http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
    but (as i am not professional user) i dont understand what to do with the scripts shown there. for example on "Step 2" it says
    "Step 2: Then, insert the following sample       HTML for 2 sample Fade In slideshows:"
    insert where?

    free flash tutorials sites list here
    http://www.links-mylinks.com/2007/10/flash-sites-free-tutorial-templates.html

Maybe you are looking for

  • After installing mountain lion safari keeps crashing

    safari crashesa after mountain lion install, no idea why. Use glimmerblocker and just updated java and flash Log: Process:         WebProcess [10909] Path:            /System/Library/PrivateFrameworks/WebKit2.framework/WebProcess.app/Contents/Mac OS/

  • Error Message While Running Sequence from Planning and/or SmartView

    Following error is thrown while running a sequence from either planning or smartview at a higher level. "*An error occurred while running the specified calc script. Check the log for details*" This is very weird because it does not happened with any

  • Optical drive not working only ejecting DVDs

    Hi guys, I have a Macbook Unibody model no MacBook5,1. The thing is a month back the optical drive stopped working. I insert a DVD, its tries to read it for about 15 seconds and ejects it. Now the funny thing is last night i tried playing Dexter on i

  • External Display Flickering/Blanking out on Windows 8.1 Boot Camp

    OK, so I have a MBP 15" Mid-2012 model running the latest versions of Mavericks and all software and drivers on Windows are up-to-date. I am using my external display through an Active HDMI adapter for Mini DisplayPort/Thunderbolt (one that broadcast

  • SWEDISH vs English version Photoshop CC 2014

    All my previous versions I've had in English and are happy with that. Now I subscribe to Photoshop CC in 2014 and got a SWEDISH version, but, I want the English version, what should I do ??