使用 Thumbnailator 从 x、y 和高度、宽度的大小开始裁剪图像
Crop image using Thumbnailator starting at x,y and size of height,width
我需要从位置 x,y 开始裁剪图像,它的大小应该是高度、宽度(从 x,y 开始)。我有以下代码:
Thumbnails
.of(url)
.size(width, height)
.crop(new Coordinate(x,y))
.toOutputStream(os);
;
但它似乎不起作用。有什么想法吗?
Thumbnails
.of(url)
.scale(1)
.sourceRegion(x, y, width, height)
.toOutputStream(os);
成功了!太糟糕了,图书馆的文档太缺乏了。这是一个非常好的。
我需要从位置 x,y 开始裁剪图像,它的大小应该是高度、宽度(从 x,y 开始)。我有以下代码:
Thumbnails
.of(url)
.size(width, height)
.crop(new Coordinate(x,y))
.toOutputStream(os);
;
但它似乎不起作用。有什么想法吗?
Thumbnails
.of(url)
.scale(1)
.sourceRegion(x, y, width, height)
.toOutputStream(os);
成功了!太糟糕了,图书馆的文档太缺乏了。这是一个非常好的。