2

我尝试像这样调整图像的大小:

aPaint.setAntiAlias(true); // Enabling this flag will cause all draw operations that support antialiasing to use it.
aPaint.setFilterBitmap(True); // enable bilinear sampling on scaled bitmaps. If cleared, scaled bitmaps will be drawn with nearest neighbor sampling, likely resulting in artifacts.
apaint.setDither(true); // Enabling this flag applies a dither to any blit operation where the target's colour space is more constrained than the source.
aCanvas.drawBitmap(aBitmap, aJSrcRect, aJDestRectf, apaint);

但是我没有很好的抗锯齿图像(它是抗锯齿的,但不是很好)。这是显示我的问题的图像

在此处输入图像描述

我该怎么做才能提高 android 下的抗锯齿质量?

4

1 回答 1

1

对于抗锯齿效果,您可以尝试像这样创建一个 Paint:

Paint paint= new Paint();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
paint.setAntiAlias(true);
paint.setFilterBitmap(true); 

最后在画布上涂上油漆:

canvas.drawBitmap(mBitmap, 0.f, 0.f, paint)
于 2017-09-15T12:55:53.967 回答