16.8. Animating Images

An exciting application for threads is animation of images. Many Web pages contain animated GIF files (GIF89A) that cycle through a sequence of images. Typically, these animated GIF files are created with graphical packages like Adobe PhotoShop and Quark, which permit selection of a sequence of equal-sized images to combine into a single GIF file. When loaded into a browser, each subimage in the GIF sequence is presented to the user in a time-sliced fashion. The Java programming language provides better control over animated GIF89A files because the sequence of images can be explicitly controlled, as can the timing interval between image updates. The basic concept for creating animated images is as follows:

  • Read the sequence ...

Get Core Web Programming, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.