网上下了
解析gif的代码,有以下几个类(可以在网上找到):
AnimatedGifEncoder
GifDecoder
LZWEncoder
NeuQuant
调用的
例子:
class="java" name="code">
public static void main(String[] args) throws ImageFormatException,
			IOException {
		GifDecoder d = new GifDecoder();
		d.read("C:\\Users\\rui\\Desktop\\1.gif");
//		d.decodeImageData();
		int n = d.getFrameCount();
		System.out.println(d.gctFlag);
		System.out.println(d.gctSize);
		System.out.println(d.gct);
//		for(int i : d.gct) System.out.println(i);
		for (int i = 0; i < n; i++) {
			BufferedImage frame = d.getFrame(i); //  frame i
			
			int t = d.getDelay(i);
			FileOutputStream fos = new FileOutputStream("C:\\Users\\rui\\Desktop\\zrzr\\" + i + ".jpg");
			
			JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos);
			encoder.encode(frame);
			fos.close();
		}
	}
问题:
解析出来的图片颜色的怪怪的,背景是红色的...反正和原来看到的gif不一样,找半天原因,可能和 
全局色表(global color table)有关,但还没弄明白。
看GIF文件
协议看的头疼!
妈呀,谁能帮帮我?!