我有一个像素艺术作品,想要将其放大。问题是,放大后由于抗锯齿处理会变得模糊不清。是否可以直接从xml中禁用抗锯齿处理?
我有一个像素艺术作品,想要将其放大。问题是,放大后由于抗锯齿处理会变得模糊不清。是否可以直接从xml中禁用抗锯齿处理?
i hope its useful
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);