Results 1 to 7 of 7

Thread: Can QPicture scale and rotate ?

  1. #1
    Join Date
    Jan 2007
    Posts
    30
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    MacOS X

    Question Can QPicture scale and rotate ?

    The documentation shows how a QPicture can be "painted" repeatedly at different locations, but I would like to know if I can scale and/or rotate it as well ?

    Are there any examples that demonstrate this ?

    Thanks.

  2. #2
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Can QPicture scale and rotate ?

    The documentation also says that you have to use QPixmap if you want to modify a image

  3. #3
    Join Date
    Jan 2007
    Posts
    30
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    MacOS X

    Default Re: Can QPicture scale and rotate ?

    I think you misunderstand the question.

    The docs say,
    The QPicture class is a paint device that records and replays QPainter commands.
    OK, so then let me define a QPicture that draws a square.
    Next, I play the QPicture onto the current QPainter.
    Next, I use the QPainter's scale method to double the scale and rotate method to turn things 45 degrees clockwise
    Now, can I "play" my QPicture again and get a double-size, rotated square ?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can QPicture scale and rotate ?

    You can rotate/scale the painter before drawing the picture on it.

  5. #5
    Join Date
    Jan 2007
    Posts
    30
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    MacOS X

    Default Re: Can QPicture scale and rotate ?

    Quote Originally Posted by wysota View Post
    You can rotate/scale the painter before drawing the picture on it.
    So then the example I roughed out would work ?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can QPicture scale and rotate ?

    Yes, it will work.

  7. #7
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Can QPicture scale and rotate ?

    Quote Originally Posted by igor View Post
    I think you misunderstand the question.

    The docs say,

    OK, so then let me define a QPicture that draws a square.
    Next, I play the QPicture onto the current QPainter.
    Next, I use the QPainter's scale method to double the scale and rotate method to turn things 45 degrees clockwise
    Now, can I "play" my QPicture again and get a double-size, rotated square ?
    Oh ok, sorry

Similar Threads

  1. GraphicsView rotate problem
    By forrestfsu in forum Qt Programming
    Replies: 7
    Last Post: 21st November 2007, 20:20

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.