@sdcx/image-crop 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ pod install
|
|
|
14
14
|
|
|
15
15
|
```
|
|
16
16
|
<ImageCropView
|
|
17
|
+
ref={imageCropViewRef}
|
|
17
18
|
style={'your style'}
|
|
18
19
|
fileUri={'your file uri'}
|
|
19
20
|
cropStyle={'circular' | 'default'}
|
|
@@ -33,3 +34,8 @@ objectRect的四个属性分别是(单位都是像素px):
|
|
|
33
34
|
3. width: 裁剪区域的宽度;
|
|
34
35
|
4. height: 裁剪区域的高度;
|
|
35
36
|
|
|
37
|
+
#### 裁剪
|
|
38
|
+
```
|
|
39
|
+
imageCropViewRef.crop()
|
|
40
|
+
```
|
|
41
|
+
然后裁剪成功后会在onCropped属性中回调裁剪后图片的uri;
|
package/lib/ImageCropView.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ interface SupperProps extends ViewProps {
|
|
|
8
8
|
cropStyle?: 'circular' | 'default';
|
|
9
9
|
}
|
|
10
10
|
interface CropViewProps extends SupperProps {
|
|
11
|
+
style?: ViewStyle;
|
|
11
12
|
onCropped: (uri: string) => void;
|
|
12
|
-
style: ViewStyle;
|
|
13
13
|
}
|
|
14
14
|
declare const ImageCropView: React.ForwardRefExoticComponent<CropViewProps & React.RefAttributes<ImageCropViewRef>>;
|
|
15
15
|
export default ImageCropView;
|
package/package.json
CHANGED
package/src/ImageCropView.tsx
CHANGED
|
@@ -16,8 +16,8 @@ interface CropViewNativeComponentProps extends SupperProps {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
interface CropViewProps extends SupperProps {
|
|
19
|
+
style?: ViewStyle
|
|
19
20
|
onCropped: (uri: string) => void
|
|
20
|
-
style: ViewStyle
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const ImageCropView = forwardRef<ImageCropViewRef, CropViewProps>(
|