Rectangle containing a widget in a screen ( used to make a screenshot )



  • Hello,
    Sorry to bug you again, i'd like to know if it is possible with Qt to get the rectangle which contains a widget in a screen, and the method works with any dimension of a screen.
    My objective is to take a screenshot of a QLabel (which contains an image) and the screenshot takes the good dimension if the image is changed.

    Thank you.



  • so, you want to make screenshoot from inside your application ?
    Use QPixmap::grabWidget to grab screenshoot of your QLabel into QPixmap, then do whatever with it.
    If you need to make screenshoot of specific part of the screen (not your application), then you can grab QDesktopWidget and then copy needed part into another QPixmap.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.