Hi,
I need some example to implement image panning in QT.
Please help me with some example on how to implement image panning in QT.
Many Thanks,
K.Chandra Sekhar
Hi,
I need some example to implement image panning in QT.
Please help me with some example on how to implement image panning in QT.
Many Thanks,
K.Chandra Sekhar
Can you be more specific?
Do you need help with the mathematics? With showing the image?
By the way: it's considered rude by me to ask a question on multiple forums.
Thanks for your reply.
I am new to QT programming and I would like to know how to implement panning of images in QT. I need help both in mathematical way and showing the images.
I guess the best "ready made" solution is a QGraphicsView with a scene and a QGraphicsPixmapItem.
Use a timer. For every time out, update a value (x, y or both). Then I guess you can use the setOffset function of the pixmap item.
Or, you could just subclass a widget, draw the image in the paint event. Again, use a timer to update values. Then draw the image panned (current x + some value or current y + some value)
Edit: instead of a timer, you can also use a timeline.
Or: react on mouse position for example.
Last edited by tbscope; 28th September 2010 at 07:07.
sekhar18k (28th September 2010)
Thank you very much for the reply.
Could you please give any references where we can get some sample code on panning so that we can start building on that.
Many Thanks,
K.Chandra Sekhar.
Bookmarks