Article View: borland.public.jbuilder.java.language
Article #15372Re: Animated GIF
From: tomschuring
Date: Tue, 22 Jun 1999 00:00
Date: Tue, 22 Jun 1999 00:00
90 lines
2657 bytes
2657 bytes
Hi Vladimir,
I found this class on this newsgroup that helped me. (It only accepts
GIF89a format though).
Tom
//------GIF89aComponent.java----------------
import java.awt.*;
public class GIF89aComponent extends Component
{
Image image;
boolean stop = false;
public GIF89aComponent(Image image)
{
super();
this.image = image;
MediaTracker mt = new MediaTracker(this);
mt.addImage(image, 9);
try { mt.waitForAll(); }
catch (Exception e){e.printStackTrace();}
}
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, this);
}
public void update(Graphics g) {paint(g);}
public boolean imageUpdate(Image img, int infoflags, int x, int
y, int width, int height)
{
if (stop) return false;
if ( (infoflags & FRAMEBITS) != 0) repaint(x, y, width,
height); return true;
}
public void stop() {this.stop = true;}
public void go() {this.stop = false; repaint();}
public boolean stopped() {return this.stop;}
public Dimension getMinimumSize()
{return new Dimension(image.getWidth(this), image.getHeight
(this));
}
public Dimension getPreferredSize()
{
return getMinimumSize();
}
}
//----------------------------------------------
In article <7ibaef$pts3@forums.borland.com>,
"Vladimir Patt" <vpatt@mll.co.il> wrote:
> Hi, everyone!
>
> I desperately need to show animated GIF's in my applet.
> Does anybody can show how to deal with animated GIF or redirect me to
place
> where I can get some information about.
>
> Thank you in advance.
>
> Vladimir Patt
>
> M.L.L. Software & Computer Industries Ltd.
> 14 Karlibach St.
> P.O.B. 20168 Tel-Aviv 61200
> ISRAEL
> 64730
>
> work: mailto:vpatt@mll.co.il
> ICQ: 36115888
>
> tel.: 972 - 3 - 5656850
> fax: 972 - 3 - 5656737
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7kml76$pv8$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7ibaef$pts3@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,23fc73899a0deaa8 X-Google-Attributes: gidf74b3,public From: tomschuring@my-deja.com Subject: Re: Animated GIF Date: 1999/06/22 Message-ID: <7kml76$pv8$1@nnrp1.deja.com> X-Deja-AN: 492287898 References: <7ibaef$pts3@forums.borland.com> X-Http-Proxy: 1.0 proxy.neca.nec.com.au:81 (Squid/2.1.PATCH2), 1.0 proxy.nec.com.au:3128 (Squid/2.1.PATCH2), 1.0 x42.deja.com:80 (Squid/1.1.22) for client 147.76.204.21, 147.76.128.21, 147.76.180.5 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Tue Jun 22 00:26:23 1999 GMT Newsgroups: borland.public.jbuilder.java.language X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)