use of com.gif4j.GifImage in project JFramework by gugumall.
the class JUtilImage method resizeGifImage.
/**
* @param srcImg
* @param destImg
* @param width
* @param height
* @param smooth
*/
public static void resizeGifImage(File srcImg, File destImg, int width, int height, boolean smooth) {
try {
// 创建一个GifImage对象
GifImage gifImage = GifDecoder.decode(srcImg);
// 1.缩放重新更改大小.
GifImage resizedGifImage2 = GifTransformer.resize(gifImage, width, height, smooth);
GifEncoder.encode(resizedGifImage2, destImg, true);
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations