帆布抗锯齿硬件加速(Android的API 11及更高版本)

编程入门 行业动态 更新时间:2024-10-11 23:26:44
本文介绍了帆布抗锯齿硬件加速(Android的API 11及更高版本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个简单的位图我画在画布及功放内;我用旋转矩阵。

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及更高版本)

本文发布于:2023-11-27 01:33:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636027.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:更高   帆布   版本   硬件加速   抗锯齿

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!