Open shahzaibali-code opened 4 years ago
import {StyleSheet, Text} from 'react-native'; import React from 'react';
import {Colors, TouchableOpacity} from 'react-native/Libraries/NewAppScreen'; import CustomCrop from 'react-native-perspective-image-cropper';
export default class App extends React.Component { componentDidMount() { const image = 'base64ImageString'; this.Image.getSize(image, (width, height) => { this.setState({ imageWidth: width, imageHeight: height, initialImage: image, rectangleCoordinates: { topLeft: {x: 10, y: 10}, topRight: {x: 10, y: 10}, bottomRight: {x: 10, y: 10}, bottomLeft: {x: 10, y: 10}, }, }); }); }
updateImage(image, newCoordinates) { this.setState({ image, rectangleCoordinates: newCoordinates, }); } crop() { this.customCrop.crop(); } render() { return (
I am getting the same error. Any updates?
import {StyleSheet, Text} from 'react-native'; import React from 'react';
import {Colors, TouchableOpacity} from 'react-native/Libraries/NewAppScreen'; import CustomCrop from 'react-native-perspective-image-cropper';
export default class App extends React.Component { componentDidMount() { const image = 'base64ImageString'; this.Image.getSize(image, (width, height) => { this.setState({ imageWidth: width, imageHeight: height, initialImage: image, rectangleCoordinates: { topLeft: {x: 10, y: 10}, topRight: {x: 10, y: 10}, bottomRight: {x: 10, y: 10}, bottomLeft: {x: 10, y: 10}, }, }); }); }
updateImage(image, newCoordinates) { this.setState({ image, rectangleCoordinates: newCoordinates, }); } crop() { this.customCrop.crop(); } render() { return (