在java中旋转GIF图像 [英] Rotate GIF images in java

查看:291
本文介绍了在java中旋转GIF图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在java中旋转GIF图像。

我读了这些有趣的两条关于在java中旋转图像的路径: trail 1 trail 2


一切正常,但是当我旋转我的GIF图像时,不再有GIF图像的动画。只显示GIF动画的第一个图像。


那么,有没有办法在旋转我的GIF图像后保留GIF动画,而不使用任何第三方库而只使用标准J2SE?
或者我是否有义务将我的GIF图像分成单张图像,逐个旋转,然后循环显示?

I am trying to rotate a GIF image in java.
I read these interresting two trails about rotating images in java : trail 1 , trail 2.

All works fine, except that when I rotate my GIF image, there is no more animation of the GIF image. Only the first image of the GIF animation is displayed.

So, is there any way to keep the GIF animation after rotating my GIF image, without using any third part library but only standard J2SE? Or will I be obliged to separate my GIF image into single images, rotate them one by one, and then display them in a loop?

我不喜欢给我写的任何一段代码,因为它与我的拙见无关。

I don't give any piece of code I wrote because it is not relevant in my humble opinion.

推荐答案

我认为GIF动画可以通过存储来实现多个帧,全部采用gif格式。
所以你只需要将旋转方法应用于每个图像,而不是整个gif。

I think animated gifs work by storing multiple frames, all in the gif format. So you just need to apply you rotation method to every single image, instead of the whole gif.

维基百科有一个非常好的格式描述

这篇关于在java中旋转GIF图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆