2017-03-13 8 views
0

私はこのライブラリを使って画像を切り抜いています。uCropとRxPaparazzoの使い方

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 

答えて

0

あなたはoptions.setAspectRatioOptions(...)またはoptions.setAspectRatio(...)代わりwithAspectRatio(...)を使用することができます。