Android canvas PaintFlagsDrawFilter 抗锯齿

来源:互联网 发布:python进行大数据分析 编辑:程序博客网 时间:2024/05/30 23:47

为画布设置抗锯齿:

canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG));

Android开发者网站上对于PaintFlagsDrawFilter构造函数中的两个参数是这样解释的:

public PaintFlagsDrawFilter(int clearBits, int setBits) Subclass of DrawFilter that affects every paint by first clearing the specified clearBits in the paint's flags, and then setting the specified setBits in the paint's flags.Parameters clearBits: These bits will be cleared in the paint's flags setBits: These bits will be set in the paint's flags 

具体啥意思,我也不清楚,有哪位大神原因赐教一下吗?

原创粉丝点击