你可以使用setImage(ImageSource imageSource, ImageViewState state)
方法是这样的:
ssiImageView.setImage(ImageSource.uri(Uri.fromFile(new File(imgFilePath))), new ImageViewState(getFitWidthScale(), new PointF(0, 0), SubsamplingScaleImageView.ORIENTATION_USE_EXIF));
private float getFitWidthScale(){
float windowWidth = App.getWindowWidth(); //Acquires window's pixel width
return = windowWidth/getImageWidth();
}
private float getImageWidth(){
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(_file.getAbsolutePath(), options);
return options.outWidth;
}