maxomato
3rd March 2011, 10:05
Hi.
I try to export QwtPlot to png file. I use this function
void XTrendViewer::makeExport( const QString& fileName )
{
QPicture picture;
QwtPlot::print( picture );
QPixmap pixmap( 800, 600 );
pixmap.fill();
QPainter painter( &pixmap );
painter.drawPicture( 0,0, picture );
painter.end();
pixmap.save( fileName );
}
But I am getting file with white space without image. How to export/save qwtPlot into png, jpg and etc.
I try to export QwtPlot to png file. I use this function
void XTrendViewer::makeExport( const QString& fileName )
{
QPicture picture;
QwtPlot::print( picture );
QPixmap pixmap( 800, 600 );
pixmap.fill();
QPainter painter( &pixmap );
painter.drawPicture( 0,0, picture );
painter.end();
pixmap.save( fileName );
}
But I am getting file with white space without image. How to export/save qwtPlot into png, jpg and etc.