
Originally Posted by
mariposa
Ich habe mit der print()-Funktion exzellente Ergebnisse erzielt, habe den Code auf Qwt 6 portiert und bin nun nicht mehr in der Lage das zu reproduzieren.
It's more important to the right thing as to do what Qwt 5 does - nevertheless I modified the bode example in Qwt 5.2 with the following code:
image.
fill( QColor( Qt
::white ).
rgb() );
plot->print(image);
image.save( "bode300-52.png" );
QImage image(3543, 2362, QImage::Format_ARGB32);
image.fill( QColor( Qt::white ).rgb() );
plot->print(image);
image.save( "bode300-52.png" );
To copy to clipboard, switch view to plain text mode
The result is the same as with Qwt 6. What exactly was the code, that gave you those excellent results ?
After updating SVN trunk ( painter transformation were killed before ) you could try the following code:
const double scaleFactor = 4.0;
const QSize sz
(3543,
2362);
image.
fill( QColor( Qt
::white ).
rgb() );
painter.scale(scaleFactor, scaleFactor);
QwtPlotRenderer renderer;
renderer.
render(d_plot,
&painter,
QRectF( QPointF(0,
0), sz
/ scaleFactor
) );
image.save( "bode.png" );
const double scaleFactor = 4.0;
const QSize sz(3543, 2362);
QImage image(sz, QImage::Format_ARGB32);
image.fill( QColor( Qt::white ).rgb() );
QPainter painter(&image);
painter.scale(scaleFactor, scaleFactor);
QwtPlotRenderer renderer;
renderer.render(d_plot, &painter, QRectF( QPointF(0, 0), sz / scaleFactor ) );
image.save( "bode.png" );
To copy to clipboard, switch view to plain text mode
Is this what you want ?
Uwe
Bookmarks