快速业务通道

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

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-17

J2ME嶄議GIF侃尖窃

扮寂:2011-04-02

窟匯倖GIF侃尖議窃?辛參受富夕頭彿坿?音俶勣湊謹議png阻

喘隈泌和?

private GIFDecode gifd; private int ind; private int gifCount; private Image frame; void initGIF() {  gifd = new GIFDecode();  gifd.read(this.getClass().getResourceAsStream("/ar.gif"));//墮秘gif夕頭  ind = 0;  gifCount = gifd.getFrameCount();//資誼屐方  System.out.println("gifCount="+gifCount); } void drawProgressBar(Graphics g, int xpos, int ypos, int anchor) {  frame = gifd.getFrame(ind);  ind++;  if (ind >= gifCount) {  ind = 0;  }  g.drawImage(frame, xpos, ypos, anchor);//儉桟紙夕 } ////////////////////////////////////////////////////////////////////////////////// import java.util.Vector; import java.io.InputStream; import javax.microedition.lcdui.Image; public class GIFDecode {   /**    * File read status: No errors.    */   public static final int STATUS_OK = 0;   /**    * File read status: Error decoding file (may be partially decoded)    */   public static final int STATUS_FORMAT_ERROR = 1;   /**    * File read status: Unable to open source.    */   public static final int STATUS_OPEN_ERROR = 2;   protected InputStream in;   protected int status;   protected int width; // full image width   protected int height; // full image height   protected boolean gctFlag; // global color table used   protected int gctSize; // size of global color table   protected int loopCount = 1; // iterations; 0 = repeat forever   protected int[] gct; // global color table   protected int[] lct; // local color table   protected int[] act; // active color table   protected int bgIndex; // background color index   protected int bgColor; // background color   protected int lastBgColor; // previous bg color   protected int pixelAspect; // pixel aspect ratio   protected boolean lctFlag; // local color table flag   protected boolean interlace; // interlace flag   protected int lctSize; // local color table size   protected int ix, iy, iw, ih; // current image rectangle   protected int lrx, lry, lrw, lrh;   protected Image image; // current frame   protected Image lastImage; // previous frame   protected byte[] block = new byte[256]; // current data block   protected int blockSize = 0; // block size   // last graphic control extension info   protected int dispose = 0;   // 0=no action; 1=leave in place; 2=restore to bg; 3=restore to prev   protected int lastDispose = 0;   protected boolean transparency = false; // use transparent color   protected int delay = 0; // delay in milliseconds   protected int transIndex; // transparent color index   protected static final int MaxStackSize = 4096;   // max decoder pixel stack size   // LZW decoder working arrays   protected short[] prefix;   protected byte[] suffix;   protected byte[] pixelStack;   protected byte[] pixels;   protected Vector frames; // frames read from current file   

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站: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号