我有一个类似于这样的代码片段:
takePicture = async function() {
if (this.camera) {
this.camera
.takePictureAsync()
.then(data => {
FileSystem.moveAsync({
from: data.uri,
to: `${FileSystem.documentDirectory}photos/Photo_${
this.state.photoId
}.jpg`
}).then(() => {
this.setState({
photoId: this.state.photoId + 1
});
Vibration.vibrate();
});
});
}
};
现在我的问题是我不知道如何将ImageManipulator插入到这个函数中。我的目的是在takePictureAsync()之后,将照片调整大小为108x192,然后将此照片移动到documentDirectory。非常感谢。