Results 1 to 2 of 2

Thread: Zooming an image to the center

  1. #1
    Join Date
    Oct 2011
    Posts
    48
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    6

    Default Zooming an image to the center

    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.

  2. #2
    Join Date
    Apr 2011
    Location
    Palma de Mallorca, Islas Baleares, Spain
    Posts
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows
    Thanks
    5
    Thanked 5 Times in 5 Posts

    Default Re: Zooming an image to the center

    Hi!

    You can see the QT example ImageViewer. 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 and QGraphicsScene. My code is based on the QT example sgvViewer.

    I hope it help you.

Similar Threads

  1. Center image on QMdiArea background
    By cia.michele in forum Qt Programming
    Replies: 0
    Last Post: 5th October 2010, 13:02
  2. Zooming image
    By MTK358 in forum Qt Programming
    Replies: 18
    Last Post: 27th September 2010, 18:25
  3. Center based image zooming
    By plagoon in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2010, 16:09
  4. Image Zooming
    By navi1084 in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2008, 12:48
  5. Set the image at the center in QLabel?
    By vishal.chauhan in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2007, 14:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.