Commit 62f445a4 authored by Syan's avatar Syan

v0.2.0

parent 6dd4a738
...@@ -18,7 +18,7 @@ const defaultOptions = { ...@@ -18,7 +18,7 @@ const defaultOptions = {
CropH: ~~(width * 0.6), // 裁剪高度,默认屏幕宽度60% CropH: ~~(width * 0.6), // 裁剪高度,默认屏幕宽度60%
isGif: false, // 是否允许选择GIF,默认false,暂无回调GIF数据 isGif: false, // 是否允许选择GIF,默认false,暂无回调GIF数据
showCropCircle: false, // 是否显示圆形裁剪区域,默认false showCropCircle: false, // 是否显示圆形裁剪区域,默认false
circleCropRadius: width/2, // 圆形裁剪半径,默认屏幕宽度一半 circleCropRadius: ~~(width / 4), // 圆形裁剪半径,默认屏幕宽度一半
showCropFrame: true, // 是否显示裁剪区域,默认true showCropFrame: true, // 是否显示裁剪区域,默认true
showCropGrid: false, // 是否隐藏裁剪区域网格,默认false showCropGrid: false, // 是否隐藏裁剪区域网格,默认false
quality: 90, // 压缩质量 quality: 90, // 压缩质量
......
...@@ -127,7 +127,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) { ...@@ -127,7 +127,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) {
if(isCrop){ if(isCrop){
if(showCropCircle) { if(showCropCircle) {
imagePickerVc.needCircleCrop = showCropCircle; //圆形裁剪 imagePickerVc.needCircleCrop = showCropCircle; //圆形裁剪
imagePickerVc.circleCropRadius = circleCropRadius / 2; //圆形半径 imagePickerVc.circleCropRadius = circleCropRadius; //圆形半径
} else { } else {
CGFloat x = ([[UIScreen mainScreen] bounds].size.width - CropW) / 2; CGFloat x = ([[UIScreen mainScreen] bounds].size.width - CropW) / 2;
CGFloat y = ([[UIScreen mainScreen] bounds].size.height - CropH) / 2; CGFloat y = ([[UIScreen mainScreen] bounds].size.height - CropH) / 2;
...@@ -243,7 +243,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) { ...@@ -243,7 +243,7 @@ RCT_EXPORT_METHOD(removeAllPhoto) {
TZImagePickerController *imagePicker = [[TZImagePickerController alloc] initCropTypeWithAsset:assetModel.asset photo:image completion:^(UIImage *cropImage, id asset) { TZImagePickerController *imagePicker = [[TZImagePickerController alloc] initCropTypeWithAsset:assetModel.asset photo:image completion:^(UIImage *cropImage, id asset) {
[self invokeSuccessWithResult:@[[self handleImageData:cropImage quality:quality]]]; [self invokeSuccessWithResult:@[[self handleImageData:cropImage quality:quality]]];
}]; }];
imagePicker.allowCrop = isCrop; // 裁剪 imagePicker.allowPickingImage = YES;
if(showCropCircle) { if(showCropCircle) {
imagePicker.needCircleCrop = showCropCircle; //圆形裁剪 imagePicker.needCircleCrop = showCropCircle; //圆形裁剪
imagePicker.circleCropRadius = circleCropRadius; //圆形半径 imagePicker.circleCropRadius = circleCropRadius; //圆形半径
......
{ {
"name": "react-native-syan-image-picker", "name": "react-native-syan-image-picker",
"version": "0.1.9", "version": "0.2.0",
"description": "React-Native 多图片选择 支持裁剪 压缩", "description": "React-Native 多图片选择 支持裁剪 压缩",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment