Qt4-preview-feedback Archive, May 2007
[Qt 4.3] Blt image upside-down
Message 1 in thread
Hi,
I've been using the Qt 4.3 snapshot 20070327 for an application which
displays images using QPainter::drawImage(). In order to flip the image I've
been scaling the image by -1 in y and then a translation of negative image
height to bring the image back onto the viewable display. This worked a
treat, however since I've moved to the RC1 version and recompiled, this
process now no longer works.
QRect rectDisplay(0, 0, m_displayWidth, m_displayHeight);
painter.scale(1, -1);
painter.translate(0, -rectDisplay.height());
painter.drawImage(rectDisplay, m_Image);
Is this the correct way to flip the image? I've tried supplying negative
values to drawImage() but I see that such functions use negative values as
an indication that the width & height should be determined from the image
itself so this doesn't work either.
How should I blt and image upside down?
Many thanks,
Simon