Quantcast
Channel: Active questions tagged qpainter - Stack Overflow
Viewing all articles
Browse latest Browse all 58

QT the pixel difference that occurs when drawing a font table on the screen and on an image with drawText

$
0
0

I am drawing a font table in Qt. I noticed that when I draw the table directly on the screen and when I draw it first on an qimage and then draw this image on the screen, the letters are shifted a few pixels.

When I draw directly on the screen, drawText draws at the coordinate I want, but when I draw on the image, drawText draws 2 pixels right and 2 pixels down from the coordinate I want. My coordinates are float. I use the same coordinates in both drawings.

I create an Arial 16 font and set HintingPreference::PreferNoHinting. Both painters use this font. Also, when I use font metrics values, I use QFontMetricsF. Thank you for your help. Version Qt 5.13.2.

pixel shift in the photo below

result image


Viewing all articles
Browse latest Browse all 58

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>