Results 1 to 3 of 3

Thread: Crop image

  1. #1
    Join Date
    Mar 2010
    Posts
    77
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    10
    Thanked 1 Time in 1 Post

    Default Crop image

    Hi everybody!


    i want to modify a image and crop that! what is best solution that i can use and is fast?

    i think i must use QPainter but i dont know how to draw region of crop with Darg and drop or mousemove event!

    thanks a lot.

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

    Default Re: Crop image

    Use QLabel to show a image. Implement a QRubberBand over the label. Then get the rect of rubber band , translate to image cordinates and crop the image using QImage::scaled.
    Then set the scaled image on the label.
    Hope this helps...

  3. The following user says thank you to aamer4yu for this useful post:

    danics (10th March 2010)

  4. #3
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2
    Thanked 21 Times in 21 Posts

    Default Re: Crop image

    If you are working with a QImage : http://doc.qt.io/qt-4.8/QImage::copy(QRect)
    Last edited by toutarrive; 10th March 2010 at 09:29.

Similar Threads

  1. QImage crop
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 6th February 2013, 07:54
  2. Replies: 6
    Last Post: 21st September 2009, 10:55
  3. Clip/crop/cut an image
    By greenvirag in forum Qt Programming
    Replies: 3
    Last Post: 15th November 2008, 13:29
  4. Picasa crop selection
    By yogeshgokul in forum Qt Programming
    Replies: 9
    Last Post: 25th June 2008, 14:42
  5. Paint Rect visible on Drag to crop image coordinate
    By patrik08 in forum Qt Programming
    Replies: 8
    Last Post: 17th March 2007, 09:04

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.