当前位置:网站首页>QT irregular shape antialiasing

QT irregular shape antialiasing

2022-06-23 07:58:00 Love life love you

Many people on the Internet use the following methods :( Other code is ignored here )

QPainter painter(this);
// Enable anti aliasing 
painter.setRenderHint(QPainter::Antialiasing, true);// Some are not here true

But it has been tested and compared , Sawtooth still exists , such as QLabel When you put an irregular figure and rotate it, the sawtooth still exists ;

After my test , After modifying the parameters, the rotation saw tooth disappears under the above conditions , The following code :

QPainter painter(this);
// Enable anti aliasing 
painter.setRenderHint(QPainter::SmoothPixmapTransform);// Modify here 

Use effect comparison :

( Before using )

( After using ) 

Although it can not be achieved completely without sawtooth , But the effect is much better than before .

ha-ha , come on. ! Oulige !

原网站

版权声明
本文为[Love life love you]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230729163116.html