是否有将多个图像合并到单个图像的方法。我看过merge_image库,但没有用。有人能帮上忙吗。我所拥有的只是图像文件的列表,我需要将其合并为单个文件。
发布于 2021-12-16 04:49:02
您可以使用编辑器
final slideLength = 180.0;
final option = ImageMergeOption(
canvasSize: Size(slideLength * count, slideLength * count),
format: OutputFormat.png(),
);
final memory = await loadFromAsset(R.ASSETS_ICON_PNG);
for (var i = 0; i < count; i++) {
option.addImage(
MergeImageConfig(
image: MemoryImageSource(memory),
position: ImagePosition(
Offset(slideLength * i, slideLength * i),
Size.square(slideLength),
),
),
);
}
for (var i = 0; i < count; i++) {
option.addImage(
MergeImageConfig(
image: MemoryImageSource(memory),
position: ImagePosition(
Offset(
slideLength * count - slideLength * (i + 1), slideLength * i),
Size.square(slideLength),
),
),
);
}
final result = await ImageMerger.mergeToMemory(option: option);
provider = MemoryImage(result);
setState(() {});https://stackoverflow.com/questions/64614394
复制相似问题