我有一个想要放大的像素艺术。问题是当我放大它时,它会导致抗锯齿变得模糊。有没有办法直接从 xml 禁用抗锯齿?
问问题
3467 次
1 回答
6
我希望它有用
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);
这是你想要的吗!?
于 2013-07-05T20:49:45.390 回答