📅  最后修改于: 2022-03-11 15:03:32.783000             🧑  作者: Mango
import { manipulateAsync, FlipType, SaveFormat } from 'expo-image-manipulator';
...
const takePic = async () => {
if (!cameraRef) return;
let photo = await cameraRef.takePictureAsync();
if (cameraType === Camera.Constants.Type.front) {
photo = await manipulateAsync(
photo.localUri || photo.uri,
[
{ rotate: 180 },
{ flip: FlipType.Vertical },
],
{ compress: 1, format: SaveFormat.PNG }
);
}
setFrontProfile(photo.uri);
};