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

Using QPainter’s drawPixmap/drawImage to draw images, the images look blurry

$
0
0

I used QPainter’s drawPixmap() to draw an image, and the result is shown as B in the following picture.

Then, I opened the same image in the image viewer program provided by Windows, zooming it even smaller, as shown in A in the following picture.

drawPixmap.jpegIt’s obvious that B is larger than A, but it is not as clear as A. B has noticeable Aliasing.

I tried setRenderHint(QPainter::Antialiasing) and setRenderHint(QPainter::SmoothPixmapTransform), it had some effect, but not enough to solve the problem.

The result is even worse when I try to draw the image using QOpenGLWidget as shown in the following image.QOpenGLWidget.png

I don’t think it’s an issue with the image’s clarity. When I use drawPixmap() to draw the image and call QPainter’s scale() method to enlarge it, I can see the details of the image.

Does anyone know how to draw images in Qt with the same level of clarity as the built-in Windows software? Even when I scale down the image, I want to avoid Aliasing problem.


Viewing all articles
Browse latest Browse all 58

Trending Articles



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