Hello.

I'm not sure if this is a bug with Java, but when I resize an animated gif,
the resulting image is no longer animated.

Here's my test applet code:

import java.awt.*;
import javax.swing.*;

public class Hello extends JApplet
{
    public void init()
    {
        Container contentPane = getContentPane();
        ImageIcon icon = new ImageIcon("animate.gif");
        contentPane.add(new JLabel(icon));
        int newWidth = (int)(.5*icon.getIconWidth() );
        int newHeight = (int)(.5*icon.getIconHeight() );
        Image image =
icon.getImage().getScaledInstance(newWidth,newHeight,Image.SCALE_AREA_AVERAG
ING);
        contentPane.add(new JLabel(new ImageIcon(image)));
    }
}

Any help will be appreciated.

Thanks,
Chris

Reply via email to