【问题标题】:Android ImageView Nearest NeighborAndroid ImageView 最近邻居
【发布时间】:2016-09-19 05:03:09
【问题描述】:

我正在创建一个需要从网络显示像素艺术的应用。

在 iOS 上,我可以设置 UIImageView 以使其放大过滤器为

imageView.layer.magnificationFilter = kCAFilterNearest

一切都会自行处理。

但是我似乎在 Android 中对此无能为力。如何更改可以交给 Android 的 imageView 的图像的放大方式?

【问题讨论】:

    标签: android image-processing imageview


    【解决方案1】:

    这是通过BitmapDrawablePaint 完成的,而不是视图,使用setFilterBitmap()

    myBitmapDrawable.getPaint().setFilterBitmap(false);
    myImageView.setImageDrawable(myBitmapDrawable);
    

    【讨论】:

    • 这对我来说非常有效! ...而且我一直认为这要复杂得多...
    猜你喜欢
    • 1970-01-01
    • 2018-09-06
    • 2020-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多