I think so too. Just the comprehension make me confused with the code I pasted.
Let me describe it in detail.
line 10 is commented, compile ->run it will create 1st image of my uploaded files.
line 10 is NOT commented, compile->run, it will create 2nd image.
balloon.jpg in line 10 is the 3rd image.
I only scaled an image and then return itself.
Added after 8 minutes:
Another phenomenon:
if the line 8 ~ line 10 such as below.
"
QImage tmpdi;
tmpdi = image.scaled(resultSize,Qt::KeepAspectRatio);
tmpdi = image.scaled(QSize(resultSize.width()*1.5, resultSize.height()*2.0),Qt::KeepAspectRatio);
"
run it, will get 2nd image of my uploaded image files.
if it changed as
"
QImage tmpdi;
QImage tmpditmp = image.scaled(resultSize,Qt::KeepAspectRatio);
tmpdi = image.scaled(QSize(resultSize.width()*1.5, resultSize.height()*2.0),Qt::KeepAspectRatio);
"
it will create 1st image.
I do not know why it gets different result? I only do create a new instance.
I Can NOT do scale operation on same object, can I?
If I do, what happen on Painter?
or the code has some defects?
Bookmarks