Results 1 to 5 of 5

Thread: Select Region from image

  1. #1
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Select Region from image

    Hello All,

    This is my first post in this forum

    I've just started writing an application for image manipuliation, I would like to have some basic functionality, like zoom in/out, rotate left/right, and select a region from the image, and being able to save this new selected region to a new instance of QImage for example

    The zoom in/out, and rotate are easily implemented, but I have a problem with the region selection, I would like to have 2 options, either select a recangle region, or the ability for the user to select irregular shape (much as MS paint)

    I actually dont know how to do either at this moment, and I would like to know if anyone can help me with this issue

    any comments are most welcomed, and thanks very much for your time reading this post

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Select Region from image

    For a rectangular selection you can use the rubber band selection mode of the graphics scene. For an irregular shape just draw a item over all other things in your scene, add some handlers that the user can modify the shape and then use the shape of that item to extract the new image.

  3. #3
    Join Date
    Feb 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Select Region from image

    I wrote an application which needs rectangular regions for processing. I used
    "QImage::copy ( const QRect & rectangle = QRect() ) const" for further processing.

    Garg

  4. #4
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Select Region from image

    Thank you guys for the response,

    I was away, and just came back, and this is why I'm late in my response

    Gargolissimus: Thank you very much, I use this, and it works,

    Lykurg: can you show me a sample code for the irregular selection

    Thanks alot

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Select Region from image

    Quote Originally Posted by yazwas View Post
    Lykurg: can you show me a sample code for the irregular selection
    I have no short code, but have e.g a look at the book "Foundations of Qt® Development" of Johan Thelin, he has a good example for that in his book.

Similar Threads

  1. Image Commander v.1.2
    By piotrek in forum Qt-based Software
    Replies: 0
    Last Post: 20th April 2009, 11:59
  2. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 16:36
  3. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 03:10
  4. Help needed handling image data
    By toratora in forum General Programming
    Replies: 2
    Last Post: 11th May 2007, 10:24
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 17:36

Tags for this Thread

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.