❝将图片,自绘形状,文本显示到屏幕时,它们的边缘都有不同的锯齿状,非常不好看。本文介绍一些抗锯齿的操作,让边缘更平滑,看起来好看点,但副作用是会额外的性能问题。❞
QPainter painter(this);
/* 尽可能消除锯齿边缘 */
painter.setRenderHint(QPainter::Antialiasing);
/* 尽可能消除文本锯齿边缘 */
painter.setRenderHint(QPainter::TextAntialiasing);
/* 启用线性插值算法以此来平滑图片 */
painter.setRenderHint(QPainter::SmoothPixmapTransform);
Rectangle {
antialiasing: true
}
QQuickItem::setAntialiasing(true);
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有