File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ yarn add react-native-image-cropper
2929- ` pinchToZoom ` Use pinch to zoom image? (default: true)
3030- ` quality ` : a value from 0 to 1 to describe the quality of the snapshot. 0 means 0% (most compressed) and 1 means 100% (best quality). (default: 1)
3131- ` type ` : the file type default value is ** "png"** , ** "jpg"** is also supported. Refer to implementations to see more supported values. (default: jpg)
32+ - ` pixelRatio ` : the pixel ratio to use for the rendering. By default the screen pixel scale will be used.
3233
3334#### ` {ImageCrop} ` Functions
3435- ` crop() ` : returns a base64 encoded image.
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React, { Component } from 'react'
22import {
33 View ,
44 Image ,
5+ PixelRatio ,
56 PanResponder
67} from 'react-native'
78
@@ -177,7 +178,7 @@ class ImageCrop extends Component {
177178 render ( ) {
178179 return (
179180 < View { ...this . _panResponder . panHandlers } >
180- < Surface width = { this . props . cropWidth } height = { this . props . cropHeight } ref = "cropit" >
181+ < Surface width = { this . props . cropWidth } height = { this . props . cropHeight } pixelRatio = { this . props . pixelRatio } ref = "cropit" >
181182 < GLImage
182183 source = { { uri : this . props . image } }
183184 imageSize = { { height : this . state . imageHeight , width : this . state . imageWidth } }
@@ -201,6 +202,7 @@ ImageCrop.defaultProps = {
201202 minZoom : 0 ,
202203 maxZoom : 100 ,
203204 quality : 1 ,
205+ pixelRatio : PixelRatio . get ( ) ,
204206 type : 'jpg' ,
205207 format : 'base64' ,
206208}
@@ -212,6 +214,7 @@ ImageCrop.propTypes = {
212214 maxZoom : React . PropTypes . number ,
213215 minZoom : React . PropTypes . number ,
214216 quality : React . PropTypes . number ,
217+ pixelRatio : React . PropTypes . number ,
215218 type : React . PropTypes . string ,
216219 format : React . PropTypes . string ,
217220}
You can’t perform that action at this time.
0 commit comments