我有一个简单的位图我画在画布及功放内;我用旋转矩阵。
I have a simple bitmap that I draw within a canvas & that I rotate using a matrix.
我碰到的问题是,使用硬件加速旋转时(这是工作完美地与硬件加速关闭)边缘没有抗锯齿。 当然,像setDrawFilter而且是无用的,因为它们在硬件加速功能开启时忽略!
The problem I bump into is that using hardware acceleration the edges are not anti-aliased when rotated (this is working perfectly with Hardware acceleration turning off). And of course things like "setDrawFilter" are useless as they are ignored when hardware acceleration is turned on!
canvas.setDrawFilter(new PaintFlagsDrawFilter(1, Paint.ANTI_ALIAS_FLAG));
我缺少的东西或者是它的硬件渲染方法只是一个限制?有没有什么别的选择吗?
Am I missing something or is it just a limitation of the hardware rendering method ? Is there any alternative?
推荐答案设置抗伪标志上的油漆也不会帮助反正。要旋转他们,你应该添加一个1px的透明边框周围时,你得到的位图抗锯齿的边界。
Setting the antialias flag on the paint would not help anyway. To get antialiased borders on bitmap when rotating them you should add a 1px transparent border around them.
更多推荐
帆布抗锯齿硬件加速(Android的API 11及更高版本)
发布评论