1

I use fresco image viewer library in my app and everything works prefect but I have a problem with rotating image. by default this library can rotate image automatically when the device screen rotation is on but I don't want to use that way.
actually I want to know how can I rotate it by touch or button click in 90 degree and it's very important to work with this library.

This is my code to show image :

 ImagePipelineConfig config = ImagePipelineConfig.newBuilder(mContext)
     .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
     .setResizeAndRotateEnabledForNetwork(true)
     .setDownsampleEnabled(true)
     .build();
 Fresco.initialize(mContext, config);


 ImageViewer.Builder builder = new ImageViewer.Builder < > (mContext, images);


 builder.setFormatter(new ImageViewer.Formatter < Image > () {
         @Override
         public String format(Image customImage) {
             return customImage.getLarge();
         }
     }).setOverlayView(overlayView)
     .show();

https://github.com/stfalcon-studio/FrescoImageViewer

Bertrand Martel
  • 42,756
  • 16
  • 135
  • 159
arman balash
  • 57
  • 1
  • 4

1 Answers1

2

Example for a 90 degree rotation:

ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(URI)
    .setRotationOptions(RotationOptions.forceRotation(RotationOptions.ROTATE_90))
    .build();

See also this example in Fresco's Showcase sample app.

Alexander Oprisnik
  • 1,212
  • 9
  • 9