Changeset 4579 in ntrip for trunk/BNC/src/rinex/graphwin.cpp
- Timestamp:
- Aug 29, 2012, 4:48:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/graphwin.cpp
r4577 r4579 138 138 void t_graphWin::slotPrint() { 139 139 140 savePNG("./", ".PNG"); 141 140 142 QPrinter printer; 141 143 QPrintDialog* dialog = new QPrintDialog(&printer, this); … … 160 162 // Save the Widget as PNG Files 161 163 //////////////////////////////////////////////////////////////////////////// 162 void t_graphWin::savePNG(const QString& dirName, QByteArray ext ,163 QwtPlot* plot) { 164 void t_graphWin::savePNG(const QString& dirName, QByteArray ext) { 165 164 166 if (dirName.isEmpty()) { 165 167 return; … … 174 176 + fileInfo.completeBaseName() + ext; 175 177 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"); 188 182 }
Note:
See TracChangeset
for help on using the changeset viewer.