0

我正在使用这个库来裁剪我的图像。

https://github.com/Yalantis/uCrop

拍摄图像:

https://github.com/miguelbcr/RxPaparazzo

要使用这个库,我正在使用RxPaparazzo

UCrop.Options options = new UCrop.Options();
            options.setShowCropFrame(true);
            options.setToolbarColor(ContextCompat.getColor(getActivity(), R.color.colorPrimaryDark));
            options.setMaxBitmapSize(1000000000);

            size = Size.Small;
            RxPaparazzo.takeImage(this)
                    .crop(options)
                    .size(size)
                    .usingGallery()
                    .subscribe(new Action1<com.fuck_boilerplate.rx_paparazzo.entities.Response<NewDiary, String>>() {
                        @Override
                        public void call(com.fuck_boilerplate.rx_paparazzo.entities.Response<NewDiary, String> response) {
                            if (response.resultCode() != Activity.RESULT_OK) {
                                response.targetUI().showUserCanceled();
                                return;
                            }

                            response.targetUI().loadImage(response.data());
                        }
                    });

现在,我想使用withAspectRatio(16, 9)功能,但我不知道如何使用?

options.withAspectRatio(16, 9) // not work
------------
 RxPaparazzo.takeImage(this)
                        .crop(options)
.withAspectRatio(16, 9) // not work
4

1 回答 1

0

您可以使用options.setAspectRatioOptions(...)options.setAspectRatio(...)代替withAspectRatio(...)

于 2017-11-08T14:10:24.230 回答