How to save the pixmap of QWidget without borders/ what is way we can save best quality image
-
QPixmap * pixmap = new QPixMap(this->size())
this render(pixmap)
pixmap->save(fileName) -
Hi
What borders ?
a widget don't have borders unless you do not give it a parent and it becomes a window? -
Well if the widget has scrollbar shown, then render will also show them.
You could disable the scrollbars. -
I have QGraphicsView and scene() is QGraphicsscene
QRectF rect = scene()->sceneRect();
QImage img(rect.width(),rect.height(), QImage::Format_RGB32);
QPainter painter(&img);
render(&painter); // , QRechow to save the pixmap without scrollbars . is it possible to get the pixmap of canvas without scrollbars how to get width of witdh of vertical and horizonal scrollbar so that I can get only rectangle for Canvas without scrollbar
-
@Qt-Enthusiast said in How to save the pixmap of QWidget without borders:
how to get width of witdh of vertical and horizonal scrollbar so that I can get only rectangle for Canvas without scrollbar
verticalScrollBar()->width()
horizontalScrollBar()->width()
Of course you'll have to make sure they are visible first
-
how to do that
-
what is way we can save best quality image
-
@Qt-Enthusiast isVisible function