you’re interested in some code … wonderful:
public class ImageLoader
{
private static ArrayList strips;
Applet applet;
ImageLoader(Applet applet)
{
this.applet = applet;
strips = new ArrayList();
}
img = new ImageIcon(getClass().getResource("ingame/door_anim.png")).getImage();
createAnimationStrip(img, 4);
private void createAnimationStrip(Image img, int number)
{
int cellHeight = img.getHeight(null);
int cellWidth = img.getWidth(null) / number;
ImageProducer sourceProducer = img.getSource();
AnimationStrip anim = new AnimationStrip();
for(int i=0; i<number; i++)
anim.add(loadCell(sourceProducer,i*cellWidth, 0, cellWidth, cellHeight));
strips.add(anim);
}
private Image loadCell(ImageProducer imageProducer, int x, int y, int width, int height)
{
return applet.createImage(
new FilteredImageSource(
imageProducer,
new CropImageFilter(x, y, width, height)
)
);
}
}
that’s my code for convertint image-strips to animation-strips. after that i expected that i’m able to use them without any problems.