QGraphicsItem screenshot
Greetings Qt Dev Network,
Is it possible to take a screenshot of a specific QGraphicsItem (Not an area of QGraphicsScene but the QGraphicsItem itself) ?
Has anyone got a straightforward implementation of this ?
Thanks guys.
B.A.
5 replies
I just gone out of this :)
Here the code I used:
- QStyleOptionGraphicsItem styleOption;
- qobject_cast<QGraphicsObject*>(item)->paint(&painter, &styleOption);
- painter.end();
here my “item” is a QDeclarativeitem, but its inerithed by QGraphicsItem, so souldn’t be any problem I think.
I wonder if item transformations can screw up the painting.
whit that code the image grabbed will be the item without transformations. But if you inscribe your item into another, you can then grab the outer one with the inner rotated :)
@deimos: your mediadownloader is a nice piece of software !
Are you playing the videos natively using FFMPEG and QPixmap(s) ?
thanks a lot. Compliments are always welcome and I didn’t received a lot even if it is been downloaded a lot :)
Video are played with phonon (I am rewriting it using QtMultimediaKit without phonon) and since youtube needs cookies and with phonon you have not direct access to network (you can’t set QNetworkRequest) I have subclassed QIODevice to threat streaming videos as a local file. They can be played also with mplayer. FFMPEG is used only to convert them.
sorry to all for this OT
@bunjee: if you want to find me I am in #qt, #meego channels at freenode irc :)
You must log in to post a reply. Not a member yet? Register here!



