快速业务通道

J2ME嶄議GIF侃尖窃 - 園殻秘壇利

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-17
protected int frameCount;   static class GifFrame {     public GifFrame(Image im, int del) {       image = im;       delay = del;     }     public Image image;     public int delay;   }   /**    * Gets display duration for specified frame.    *    * @param n    *      int index of frame    * @return delay in milliseconds    */   public int getDelay(int n) {     delay = -1;     if ((n >= 0) && (n < frameCount)) {       delay = ((GifFrame) frames.elementAt(n)).delay;     }     return delay;   }   /**    * Gets the number of frames read from file.    *    * @return frame count    */   public int getFrameCount() {     return frameCount;   }   /**    * Gets the first (or only) image read.    *    * @return BufferedImage containing first frame, or null if none.    */   public Image getImage() {     return getFrame(0);   }   /**    * Gets the "Netscape" iteration count, if any. A count of 0 means repeat    * indefinitiely.    *    * @return iteration count if one was specified, else 1.    */   public int getLoopCount() {     return loopCount;   }   /**    * Creates new frame image from current data (and previous frames as    * specified by their disposition codes).    */   protected void setPixels() {     // expose destination image''s pixels as int array     int[] dest = new int[width * height];     // fill in starting image contents based on last image''s dispose code     if (lastDispose > 0) {       if (lastDispose == 3) {         // use image before last         int n = frameCount - 2;         if (n > 0) {           lastImage = getFrame(n - 1);         } else {           lastImage = null;         }       }       if (lastImage != null) {         lastImage.getRGB(dest, 0, width, 0, 0, width, height);         // copy pixels         if (lastDispose == 2) {           // fill last image rect area with background color           int c = 0;           if (!transparency) {             c = lastBgColor;           }           for (int i = 0; i < lrh; i++) {             int n1 = (lry + i) * width + lrx;             int n2 = n1 + lrw;             for (int k = n1; k < n2; k++) {               dest[k] = c;             }           }         }       }     }     // copy each source line to the appropriate place in the destination     int pass = 1;     int inc = 8;     int iline = 0;     for (int i = 0; i < ih; i++) {       int line = i;       if (interlace) {         if (iline >= ih) {           pass++;           switch (pass) {             case 2:  

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号