Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]Help with Image Cropping

[SOLVED]Help with Image Cropping

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k Views
  • 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.
  • B Offline
    B Offline
    b1gsnak3
    wrote on last edited by
    #1

    Hello!

    I need to create something like a selector for an image so I can choose which part of the image i want to keep (whole image, bits and pieces etc.) AKA crop the image. I know I can use QPixmap::copy for the actual cropping but I need to get the point from which to crop, width and height (via a selector). I have no idea what to use to do this :D Any help would be much appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      One solution is to subclass QLabel and get the starting and ending point using mousePress and mouseRelease event making the rectangle from these coordinates.

      You can use a QRubberBand for the "selection effect"

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        b1gsnak3
        wrote on last edited by
        #3

        Thank you I think I can use that :)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved