Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this.camera.takePictureAsync().then(obj => {
  2.         const uri = obj.uri;
  3.         const width = obj.width;
  4.         const height = obj.height;
  5.         let picPath = LATEST_IMG
  6.         ImageManipulator.manipulateAsync(uri,
  7.           [{resize: {width: 0.25 * width, height: 0.25 * height}}, {flip: {horizontal: true}}], {base64: true, format: 'jpeg'})
  8.           .then(obj => {
  9.             const uriFlipped = obj.uri;
  10.             const base64 = obj.base64;
  11.             FileSystem.writeAsStringAsync(LATEST_IMG, base64).then(() => console.log('photo saved'))
  12.             this.setState({takingPhoto: false, photo: uriFlipped})
  13.         });        
  14.       })
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement