Changeset 4579 in ntrip for trunk/BNC/src/rinex/graphwin.cpp


Ignore:
Timestamp:
Aug 29, 2012, 4:48:42 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/graphwin.cpp

    r4577 r4579  
    138138void t_graphWin::slotPrint() {
    139139
     140  savePNG("./", ".PNG");
     141
    140142  QPrinter printer;
    141143  QPrintDialog* dialog = new QPrintDialog(&printer, this);
     
    160162// Save the Widget as PNG Files
    161163////////////////////////////////////////////////////////////////////////////
    162 void t_graphWin::savePNG(const QString& dirName, QByteArray ext,
    163                          QwtPlot* plot) {
     164void t_graphWin::savePNG(const QString& dirName, QByteArray ext) {
     165
    164166  if (dirName.isEmpty()) {
    165167    return;
     
    174176                   + fileInfo.completeBaseName() + ext;
    175177
    176   if (plot) {       
    177     QwtPlotRenderer renderer;
    178     renderer.setDiscardFlag(QwtPlotRenderer::DiscardBackground, false);
    179     renderer.setLayoutFlag(QwtPlotRenderer::KeepFrames, true);
    180     renderer.renderDocument(plot, fileName, QSizeF(300, 200), 85);
    181   }
    182   else {
    183     QImage image(_canvas->size(), QImage::Format_RGB32);
    184     QPainter painter(&image);
    185     _canvas->render(&painter);
    186     image.save(fileName,"PNG");
    187   }
     178  QImage image(_canvas->size(), QImage::Format_RGB32);
     179  QPainter painter(&image);
     180  _canvas->render(&painter);
     181  image.save(fileName,"PNG");
    188182}
Note: See TracChangeset for help on using the changeset viewer.