Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How to select a part of an image with eight draggable points?

    General and Desktop
    2
    2
    678
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yoll522 last edited by

      Excuse me, I use QRubberBand to select a part of an image like this one:
      http://imageshack.us/photo/my-images/40/qaxi.jpg/
      http://imageshack.us/photo/my-images/600/p58j.jpg/

      But I would like it to have eight draggable points within the edge so that the selected area can be resized, e.g.
      http://imageshack.us/photo/my-images/23/24qn.jpg/

      Please give me some tips, thank you so much!

      1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by

        you can go with QGraphicsView and add the pixmap in there.

        Then you sublass QGraphicsRectItem and add also graphics items (also QgraphicsRectItem's if you want) as child items and position them correctly.
        Then react on the mouse events in that child items and resize the parent rect item accordingly. The code to do that shouldn't be that complicated.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 0
        • First post
          Last post