View Full Version : Can QPicture scale and rotate ?
igor
25th January 2007, 20:47
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 ? :confused:
Are there any examples that demonstrate this ?
Thanks. :D
gri
25th January 2007, 21:00
The documentation also says that you have to use QPixmap if you want to modify a image :)
igor
25th January 2007, 21:09
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 ?
wysota
25th January 2007, 21:15
You can rotate/scale the painter before drawing the picture on it.
igor
25th January 2007, 21:20
You can rotate/scale the painter before drawing the picture on it.
So then the example I roughed out would work ? :o
wysota
25th January 2007, 21:24
Yes, it will work.
gri
25th January 2007, 22:48
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 :)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.