【问题标题】:set image from Gallery or Camera to fit to Imageview android从图库或相机设置图像以适合 Imageview android
【发布时间】:2015-11-29 18:38:57
【问题描述】:

我将图像从图库和相机设置为 Imageview。我使用 Touchimageview 为 imageview 提供捏缩放功能。

这是此 Touchimageview 的链接:https://github.com/MikeOrtiz/TouchImageView/blob/master/src/com/ortiz/touch/TouchImageView.java

但是在 Imageview 中没有正确设置图像。

在图片中,

左边是我实际发生的事情。

我希望适合 imgeview 的右侧与 Imageview 高度相同。

我使用了 ScaleType = "CenterCrop" 但之后我无法在 Imageview 中放大。

1).How to Crop Bitmap Like Fit to imageview with keep aspect resio?

2).or 如何将来自画廊或相机的图像设置为适合图像视图并添加放大功能?

帮我解决这个问题

提前谢谢你

【问题讨论】:

    标签: android image scale crop bitmapimage


    【解决方案1】:

    对于可缩放的 ImageView 用户 Gesture ImageView 库

    您可以从这里下载库,它很容易使用。此库为您提供可缩放的 ImageView,因此使用 Gesture ImageView 而不是 Simple ImageView

    https://github.com/jasonpolites/gesture-imageview

    【讨论】:

      【解决方案2】:

      使用android:scaleType="fitxy"。确保您的图像具有更高的分辨率,否则图像将失去其质量。如果图像不保持纵横比,它也可能看起来被拉伸

      【讨论】:

        猜你喜欢
        • 2013-07-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-10-21
        • 2015-10-19
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多