Results 1 to 3 of 3

Thread: how to rotate an image...

  1. #1
    Join Date
    Nov 2008
    Posts
    52
    Qt products
    Qt4
    Platforms
    Windows

    Default how to rotate an image...

    I want to know how to rotate an image.I have searched the forum but could find what i want.please help.

  2. #2
    Join Date
    Jan 2009
    Location
    Istanbul
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to rotate an image...

    You can use QGraphicsPixmapItem. QGraphicsItem has rotate(angle) method.
    This piece of code can be usefull.

    Qt Code:
    1. QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(QPixmap("image.bmp"));
    2. scene->addItem(pixmapItem);
    3. ...
    4. pixmapItem->rotate(15);
    To copy to clipboard, switch view to plain text mode 


    And read the qassistant for further need...
    Last edited by jpn; 16th January 2009 at 15:28. Reason: missing [code] tags

  3. #3
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to rotate an image...

    vague question... vague answer...

    you can create a QMatrix (or a QTransform) for your rotation angle and then rotate your image (assuming you have a QImage) with QImage::transformed()
    HTH

Similar Threads

  1. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 15:36
  2. GraphicsView rotate problem
    By forrestfsu in forum Qt Programming
    Replies: 7
    Last Post: 21st November 2007, 20:20
  3. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  4. Explanation to Image Formats
    By sincnarf in forum Qt Programming
    Replies: 13
    Last Post: 6th July 2007, 17:02
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36

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.