在扩展android中的imageview时如何禁用抗锯齿?
作者:互联网
我有一个像素艺术,我想扩大规模.问题是当我扩展它时,它会得到抗锯齿的所有模糊原因.有没有办法直接从xml禁用抗锯齿?
解决方法:
我希望它有用
Bitmap bmpSource = BitmapFactory.decodeResource(getResources(), SourceFileId);
//100 is dimension to resizing image size
//Passing filter = false will result in a blocky, pixellated image.
//Passing filter = true will give you smoother edges
Bitmap bmpScaled = Bitmap.createScaledBitmap(bmpSource, 100, 100, false);
ImageView img = (ImageView) findViewById(Your imageView Control Id);
img.setImageBitmap(bmpScaled);
这就是你想要的!?
标签:android,scaling,imageview,antialiasing 来源: https://codeday.me/bug/20190831/1778131.html