带有 RoundedBitmapDrawable 的圆形图像被像素化
Circular image with RoundedBitmapDrawable is pixelated
这是我正在做的事情
public static RoundedBitmapDrawable getRoundedBitmap(Resources res, Bitmap bitmap){
RoundedBitmapDrawable roundBitMap = RoundedBitmapDrawableFactory.create(res,bitmap);
roundBitMap.setCornerRadius(Math.max(bitmap.getWidth(), bitmap.getHeight()) / 1.25f);
return roundBitMap;
}
它给了我一张圆形图像,但它在圆的边缘像素化了。知道如何让它顺利吗?或者我应该使用旧技术?
你只需要调用roundBitMap.setAntiAlias(true);
这是我正在做的事情
public static RoundedBitmapDrawable getRoundedBitmap(Resources res, Bitmap bitmap){
RoundedBitmapDrawable roundBitMap = RoundedBitmapDrawableFactory.create(res,bitmap);
roundBitMap.setCornerRadius(Math.max(bitmap.getWidth(), bitmap.getHeight()) / 1.25f);
return roundBitMap;
}
它给了我一张圆形图像,但它在圆的边缘像素化了。知道如何让它顺利吗?或者我应该使用旧技术?
你只需要调用roundBitMap.setAntiAlias(true);