GLC_lib & GLC_Player Forums
https://forum.glc-lib.net/

Cropping an image: How to map model point to screen?
https://forum.glc-lib.net/viewtopic.php?f=4&t=943
Page 1 of 1

Author:  agalavis [ Mon Jun 24, 2013 11:45 am ]
Post subject:  Cropping an image: How to map model point to screen?

Hello,
I want to take a screenshot of the objects i have on the scene, but removing all the background so the image size is the same as the bounding box of my collection.
I'm thinking that i should have something like this:
Code:
   
//Crop the image to remove the background if the option is checked
    if(cropBackground->isChecked())
    {
        QImage croppedimage;
        GLC_BoundingBox box = m_pOpenglView->globalBoundingBox();

        //Map the bounding box to the screen-projected image
        ???

        QRect cropbox = QRect( whatever);
        cropedImage = imageToSave.copy(cropbox);
    }

and I saw that the GLC_ViewPort has an unProject method which makes the opposite of what I want, so I just wanted to ask if maybe i'm looking in the wrong place and there is already a way to get screen coordinates for the bounding box.
Thanks in advance for any help!

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/