Results 1 to 2 of 2

Thread: how to move the image in QLabel

  1. #1
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default how to move the image in QLabel

    Hi Guys,

    I have placed a Image in a QLabel.

    Now when i zoom in and out i need to view the up, down, Right and Left portions of the Image in Qlabel.

    How can i achieve this using both mouse click and drag and also using Buttons provided to move in all positions to view the image.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to move the image in QLabel

    You can use graphics view framework... zooming operations are easy in that.

    If you want to do with a QLabel, would suggest to put QLabel in a QScrollArea. Then on zoom in - resize QLabel,, and on move events, move the scroll area.

    Lastly if you want to do everything in the QLabel itself, you will need to catch the key press events and do operations accordingly..
    eg - zoom in : scale image, show part of it in QLabel.. move : copy part of scaled image onto the label.

    Hope you get the idea

Similar Threads

  1. Replies: 6
    Last Post: 21st September 2009, 10:55
  2. QLabel as an image.
    By RSX in forum Newbie
    Replies: 2
    Last Post: 4th April 2009, 19:22
  3. how can we move an image?
    By sh123 in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2009, 12:46
  4. Show Image on a QLabel
    By ^NyAw^ in forum Newbie
    Replies: 11
    Last Post: 15th April 2008, 15:45
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.