How can I read an image and resize it?
-
@
QPixmap pix = QPixmap("path-to-your-file").scaled(QSize(100,80));
@Take a look at the docs for the "scaled":http://qt-project.org/doc/qt-4.8/qpixmap.html#scaled method's parameters.
-
[quote author="raven-worx" date="1367562015"]@
QPixmap pix = QPixmap("path-to-your-file").scaled(QSize(100,80));
@Take a look at the docs for the "scaled":http://qt-project.org/doc/qt-4.8/qpixmap.html#scaled method's parameters.[/quote]
Thanks dear
In vs we use picturebox in forms to show an image . And we can show the image with writing picturebox.image("image addresss"); in our code . How can I do it in Qt ? -
i don't know picturebox controls .... but take a look at "QPixmap::loadFromData()":http://qt-project.org/doc/qt-4.8/qpixmap.html#loadFromData and it's overloads. I'm pretty sure you can get the data out from your existing Image.