hi,
is it possible to take a picture from a certain place of the MainWindow and save it? like printscreen but only a piece and certain place of my window must be in the picture.
hi,
is it possible to take a picture from a certain place of the MainWindow and save it? like printscreen but only a piece and certain place of my window must be in the picture.
Alex22 (25th December 2015)
Thanks d_stranz, I could save the entry of myMainWindow by under code:
Qt Code:
MainWindow *w; w = new MainWindow; w->render(&pixmap); pixmap.save("h.bmp"); w->show();To copy to clipboard, switch view to plain text mode
I need to take an image from into the red box that you can see in the uploaded image. That the positions are:
position 1: beginning of "GroupBox"
position 2: top right of "b1"
position 3: down left of "GroupBox"
position 4: x=down left of "GroupBox", y=top right of "b1"
thanks for any help about working with 4 above positions because the size of MainWindow can be changed by pulling the window.
Screen.jpg
If you only want the groupbox then call its render() method.
If you need things across container widgets, render the widget that contains all and use QPixmap::copy() to extract the part you are interested in.
Cheers,
_
You could put the buttons and the groupbox into a container widget and then render this widget.
Or you just calculate the coordinates manually and use the already mentioned copy method.
Cheers,
_
Bookmarks