如何将图像分割成多个较小的图像

如何将Image对象( java.awt.Image )拆分为较小的图像?

例如,将64 * 64px图像分割为16张16 * 16px图像的精灵表。

请参阅: http : //rameshjavablog.blogspot.com/2012/04/sub-image-from-image-using-java.html

使用如下function:

image = createImage(new FilteredImageSource(image.getSource(),new CropImageFilter(13, 13, 143, 163)));

您正在使用“裁剪图像filter”创建图像。

那么它应该只是迭代原始图像抓住你想要的不同方块。