We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 ( <React.Fragment> <CustomCrop updateImage={this.updateImage.bind(this)} rectangleCoordinates={this.state.rectangleCoordinates} initialImage={this.state.initialImage} height={this.state.imageHeight} width={this.state.imageWidth} ref={(ref) => (this.customCrop = ref)} overlayColor="rgba(18,190,210, 1)" overlayStrokeColor="rgba(20,190,210, 1)" handlerColor="rgba(20,150,160, 1)" enablePanStrict={false} /> CROP IMAGE </React.Fragment> ); } }
see my code
The text was updated successfully, but these errors were encountered:
I am getting the same error. Any updates?
Sorry, something went wrong.
No branches or pull requests
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 (
<React.Fragment>
<CustomCrop
updateImage={this.updateImage.bind(this)}
rectangleCoordinates={this.state.rectangleCoordinates}
initialImage={this.state.initialImage}
height={this.state.imageHeight}
width={this.state.imageWidth}
ref={(ref) => (this.customCrop = ref)}
overlayColor="rgba(18,190,210, 1)"
overlayStrokeColor="rgba(20,190,210, 1)"
handlerColor="rgba(20,150,160, 1)"
enablePanStrict={false}
/>
CROP IMAGE
</React.Fragment>
);
}
}
see my code
The text was updated successfully, but these errors were encountered: