2017-03-13 1 views
0

Ich benutze diese Bibliothek, um meine Bilder zu beschneiden.So verwenden Sie uCrop und RxPaparazzo

https://github.com/Yalantis/uCrop

nehmen Bilder:

https://github.com/miguelbcr/RxPaparazzo

diese Bibliothek zu verwenden, ich bin mit 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()); 
         } 
        }); 

jetzt möchte ich withAspectRatio(16, 9) Funktion verwenden, aber ich weiß nicht wie kann ich benutzen?

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

Antwort

0

können Sie options.setAspectRatioOptions(...) oder options.setAspectRatio(...) statt withAspectRatio(...) verwenden.