prasad.ece2
19th March 2014, 15:29
hi,
i need to extract the frames from the video file and then need to show all the frames in a time line. i have extracted all the frames and make each of the frame as QPixmap, then i am adding them to a scene. the problem is i have to add more than 3000 pixmaps to the scene (some times 5000+ images i need to add), the system getting struck when i add pix maps to the scene.
this i have tried in 2 way
1) i took 1 viwe & 1 Scene -> add all the pix maps to scene (by scaling them so that they will fit into time line).
2) for each pixmap i took 1 view & 1 scene -> add each pix maps to corresponding scenes -> add all the views to scrollBar area .
in both the ways system gets struck...
each time i run the app its is adding the images one by one to timeline slowly after some time the application is getting struck, i am restarting my system each time i run this application.
below i added screen shot how this app look like .
i am not sure why this is happening, is this because of we are adding more items to the scene or else do we need to take any special care while dealing with Pixmap.
here is the main code where app gets slow .
m_scene->setSceneRect(rect); //set scene rect depnd on no.of images
for loop for all the images
{
QPixmap tempImage = QPixmap::fromImage(qImage);
m_imageItem = new QGraphicsPixmapItem(tempImage);
m_imageItem->scale(0.1,0.1);
m_imageItem->setPos(pos);
m_scene->addItem(m_imageItem); // add the images to time line scene
}
thanks in advance :-) .
10147s
i need to extract the frames from the video file and then need to show all the frames in a time line. i have extracted all the frames and make each of the frame as QPixmap, then i am adding them to a scene. the problem is i have to add more than 3000 pixmaps to the scene (some times 5000+ images i need to add), the system getting struck when i add pix maps to the scene.
this i have tried in 2 way
1) i took 1 viwe & 1 Scene -> add all the pix maps to scene (by scaling them so that they will fit into time line).
2) for each pixmap i took 1 view & 1 scene -> add each pix maps to corresponding scenes -> add all the views to scrollBar area .
in both the ways system gets struck...
each time i run the app its is adding the images one by one to timeline slowly after some time the application is getting struck, i am restarting my system each time i run this application.
below i added screen shot how this app look like .
i am not sure why this is happening, is this because of we are adding more items to the scene or else do we need to take any special care while dealing with Pixmap.
here is the main code where app gets slow .
m_scene->setSceneRect(rect); //set scene rect depnd on no.of images
for loop for all the images
{
QPixmap tempImage = QPixmap::fromImage(qImage);
m_imageItem = new QGraphicsPixmapItem(tempImage);
m_imageItem->scale(0.1,0.1);
m_imageItem->setPos(pos);
m_scene->addItem(m_imageItem); // add the images to time line scene
}
thanks in advance :-) .
10147s