Difference between revisions of "Animation"

From Progzoo
Jump to: navigation, search
Line 12: Line 12:
  
 
   public static void main(String argv []){
 
   public static void main(String argv []){
    BufferedImage image = new BufferedImage(QwidthQ,QheightQ, BufferedImage.TYPE_INT_ARGB);
 
    Graphics2D g = image.createGraphics();
 
 
     try {
 
     try {
 
         Gif89Encoder genc = new Gif89Encoder();
 
         Gif89Encoder genc = new Gif89Encoder();
 
         for (int i=0;i<QframesQ;i++){
 
         for (int i=0;i<QframesQ;i++){
 +
          BufferedImage image = new BufferedImage(QwidthQ,QheightQ, BufferedImage.TYPE_INT_ARGB);
 +
          Graphics2D g = image.createGraphics();
 
           drawFrame(g,i);
 
           drawFrame(g,i);
 
           genc.addFrame(image);
 
           genc.addFrame(image);
 
         }
 
         }
       
 
 
         genc.setUniformDelay(10);
 
         genc.setUniformDelay(10);
 
         genc.setLoopCount(1);
 
         genc.setLoopCount(1);

Revision as of 17:33, 16 November 2008

The animations here rely on Gif89Encoder available from http://jmge.net/java/gifenc/ developed by JMG Elliot.

Moving block


[Font] [Default] [Show] [Resize] [History] [Profile]