Java生成gif动画

 

BufferedImage src = ImageIO.read(new File(“c:/ship.jpg”)); // 读入文件
BufferedImage src1 = ImageIO.read(new File(“c:/ship2.jpg”)); // 读入文件
BufferedImage src2 = ImageIO.read(new File(“c:/ship3.jpg”)); // 读入文件
AnimatedGifEncoder e = new AnimatedGifEncoder();
e.setRepeat(0);
e.start(“c:/laoma.gif”);
e.setDelay(3000); // 1 frame per sec
e.addFrame(src);
e.setDelay(1000);
e.addFrame(src1);
e.setDelay(100);
e.addFrame(src2);
e.finish();
 

 

 

<!-- if you paginate pages--> <!-- end of post and end of loop-->

你可能感兴趣的:(java,C++,c,C#)