Android中一些Paint常量的含义
Android 中有一些 Paint 常量,我找不到太多信息。谁能帮我解释一下这些标志:
- LINEAR_TEXT_FLAG
- SUBPIXEL_TEXT_FLAG
- FILTER_BITMAP_FLAG
“子像素”模式是否接近 ClearType 还是完全不同?
There are a few Paint constant in Android about which I couldn't find much info. Could anyone help me with a bit of explanation about those flags:
- LINEAR_TEXT_FLAG
- SUBPIXEL_TEXT_FLAG
- FILTER_BITMAP_FLAG
Is 'subpixel' mode something close to ClearType or is it something altogether different?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SUBPIXEL确实用于子像素抗锯齿,目前Android上不支持。设置此标志不会产生任何效果。 FILTER_BITMAP 用于在位图转换(例如缩放)时对位图应用双线性过滤。启用 FILTER_BITMAP 通常是个好主意,除非速度比质量更重要。 LINEAR_TEXT 用于以 64px 文本大小绘制文本,并将比例因子设置为 textSize/64。
SUBPIXEL is indeed for sub-pixel antialiasing, which is currently not supported on Android. Setting this flag will have no effect. FILTER_BITMAP is used to apply bilinear filtering to bitmaps when they are transformed (scaled for instance.) It's usually a good idea to enable FILTER_BITMAP unless speed matters (much) more than quality. LINEAR_TEXT is used to draw text at a 64px text size with a scale factor set to your textSize/64.