Hi Friends,
i am facing the problem while export the qwt plot as the png image....
the problem is : in the saved "export.png" image...it is not preserving the aspect ratio(i.e if we check the 0 to 0.1 in x & y direction it is not same)... but i want to maintain the same distance in x & y direction.
it is correctly maintaining in the widget..please refer "plotwidget.png"...
my code snippet for export the qwt plot into png file:
const double scaleFactor = 2.0;
const QSize sz(800,640);
QString saveFileName="airfoilgeom.png";
QwtPlotRenderer renderer;
QString windirpath = dirpath.replace("/","\\");
QImage image0(sz, QImage::Format_ARGB32);
image0.fill( QColor( Qt::white ).rgb() );
QPainter painter0(&image0);
painter0.scale(scaleFactor, scaleFactor);
renderer.setDiscardFlag(QwtPlotRenderer:iscardBackground, false);
renderer.setLayoutFlag(QwtPlotRenderer::KeepMargin s, true);
renderer.setLayoutFlag(QwtPlotRenderer::KeepFrames , true);
renderer.render(airfoilgeomplots.at(j), &painter0, QRectF(QPointF(0, 0),sz / scaleFactor));
image0.save(windirpath+"\\LSWT_Report\\Report\\Plo ts\\"+saveFileName);
can anyone help me to solve the problem?????
Thanks & Regards,
Muthulingam
Bookmarks