View Full Version : Zooming an image to the center
A9am
2nd November 2011, 04:01
Hai,
I have a QLabel and in that an image. I want to zoom the image to the center using mouse.How can I do this?
Thanks.
sergio87
2nd November 2011, 07:54
Hi!
You can see the QT example ImageViewer (http://doc.qt.nokia.com/latest/widgets-imageviewer-imageviewer-cpp.html). This example zoom the image to the center of the scroll bar. I don't know how can you center on the mouse position with QLabel.
I center on the mouse position (google maps like) with QGrapthicsView (http://doc.qt.nokia.com/latest/widgets-imageviewer-imageviewer-cpp.html) and QGraphicsScene (http://doc.qt.nokia.com/latest/qgraphicsscene.html). My code is based on the QT example sgvViewer (http://doc.qt.nokia.com/stable/painting-svgviewer.html).
I hope it help you. :p
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.