'圖像渲染:像素化;' 喜歡在 ImageView 上?

知乎

使用 CSS,您可以使用“image-rendering: pixelated;”為 img 標籤添加樣式。

有沒有辦法在Android中做到類似的效果?

錯誤

您可以通過設置setFilterBitmap(false)Drawable對象(或Paint使用 時的對象)來實現(關閉抗鋸齒Canvas)。

Drawable drawable = getDrawable(R.drawable.sample);
drawable.setFilterBitmap(false);

ImageView imageView = findViewById(R.id.imageView);
imageView.setImageDrawable(drawable);

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章