Flutter 将裁剪图像抖动到点和大小

Flutter 将裁剪图像抖动到点和大小,flutter,Flutter,我想把人体图像裁剪成护照大小。 在firebase_ml_vision插件的帮助下,我得到了像这样的图像上的人脸点 Rect.fromLTRB(74.0, 135.0, 359.0, 420.0). 现在我想通过增加一些高度和宽度来裁剪这些点的图像 如何使用坐标裁剪图像 谢谢。你可以使用图书馆 以下是所需的方法: Image copyCrop(Image src, int x, int y, int w, int h) { //do something } 您可以这样使用它: fina

我想把人体图像裁剪成护照大小。 在firebase_ml_vision插件的帮助下,我得到了像这样的图像上的人脸点

Rect.fromLTRB(74.0, 135.0, 359.0, 420.0).
现在我想通过增加一些高度和宽度来裁剪这些点的图像

如何使用坐标裁剪图像

谢谢。

你可以使用图书馆

以下是所需的方法:

Image copyCrop(Image src, int x, int y, int w, int h) {
   //do something
}
您可以这样使用它:

final Image croppedImage = copyCrop(originalImage, 74.0, 135.0, 359.0 - 74.0, 420.0 - 135.0);
你可以使用图书馆

以下是所需的方法:

Image copyCrop(Image src, int x, int y, int w, int h) {
   //do something
}
您可以这样使用它:

final Image croppedImage = copyCrop(originalImage, 74.0, 135.0, 359.0 - 74.0, 420.0 - 135.0);