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.
It’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.
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.