Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Changing size of image
Hi. I want to load .bmp file to QImage, add some pixels and change QImage's size. QImage is part o a class, eg.:
class obraz : public QGraphicsView
explicit obraz(QWidget *parent = 0);
How to change QImage size?
KA51O last edited by
You mean like "scaling":http://developer.qt.nokia.com/doc/qt-4.8/qimage.html#scaled an image ?
Doesn't work. And how to load another QImage to QImage?
koahnig last edited by
[quote author="grizz" date="1328524306"]Doesn't work. [/quote]
Did you observe that scaled returns the scaled QImage?
It is not listed in "the in-place section":http://developer.qt.nokia.com/doc/qt-4.8/qimage.html#image-transformations
[quote author="grizz" date="1328524306"]And how to load another QImage to QImage?[/quote]
Did you try ?:
Image = Image.scaled(Size, Qt::KeepAspectRatio);
Now it works. I tried something like that earlier and it didn't work, but now I know what I made wrong. Thank you.