0

enter image description hereI have a QGraphicsScene on which I show a video . I have another red colour rectangle which is QGraphicsItem. This rectangle (QGraphicsPixmapItem) lies on the image on QGraphicsScene. I have a yellow rectangular box (QGraphicsItem) which I use to zoom area on the scene. I show the part of area under yellow box by cropping the video to the respective co ordinates in another View window. However if the zoom window overlaps with red rectangle I want to show the part of red rectangle under the zoom window. How can I do this?

Thank you. enter image description here

Sid411
  • 703
  • 2
  • 9
  • 25
  • An example image of what you're asking about would really help here. – TheDarkKnight Feb 05 '14 at 08:58
  • @merlin I have added an image.Is it visible? – Sid411 Feb 05 '14 at 09:15
  • Ok can you tell me how to do this. I had tried rendering as an option but I can't render multiple items as frames are coming continuously. Also cannot draw lines for various cases of rectangle region. – Sid411 Feb 05 '14 at 09:20
  • "by cropping the video to the respective co ordinates in another View window" Is this other view window a GraphicsView on a different QGraphicsScene? – TheDarkKnight Feb 05 '14 at 09:27
  • The other window is a graphicsview. Cropping only the video is not the problem as it is only a QImage. So I can use the copy function. But I have to crop along with the red rectangle coming under the zoom window. So how do I crop the entire scene coming under the zoom window? Thank You – Sid411 Feb 05 '14 at 09:34
  • But is the GraphicsView attached to the same or a different scene? – TheDarkKnight Feb 05 '14 at 09:47
  • The other graphics view is attached to a different scene. I tried attaching it to the same scene and using setSceneRect but setSceneRect places the view in a different position altogether. It doesn't crop anything. – Sid411 Feb 05 '14 at 09:48
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/46830/discussion-between-merlin069-and-sid411) – TheDarkKnight Feb 05 '14 at 10:13
  • The most important question is how your tree of your `QGraphicsItem`s looks like. If you did it correctly then applying a [transformation](http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#transformations) on common parent of both rectangles should do the trick (I suspect that similar transformation should be also applied for video). – Marek R Feb 05 '14 at 11:15

0 Answers0