mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-21 06:13:41 +00:00
Add image saving to SVG format
This allows to create images independent from screen resolution Replaced copy-pasted screenshot code with the single implementation
This commit is contained in:
parent
bbd1bce0b8
commit
56dbec82d4
14 changed files with 96 additions and 62 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "preferences.h"
|
||||
#include "appwindow.h"
|
||||
#include "ui_XYPlotConstantLineEditDialog.h"
|
||||
#include "screenshot.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <cmath>
|
||||
|
|
@ -349,17 +350,7 @@ void TraceXYPlot::updateContextMenu()
|
|||
auto image = new QAction("Save image...", contextmenu);
|
||||
contextmenu->addAction(image);
|
||||
connect(image, &QAction::triggered, [=]() {
|
||||
auto filename = QFileDialog::getSaveFileName(nullptr, "Save plot image", Preferences::getInstance().UISettings.Paths.image, "PNG image files (*.png)", nullptr, Preferences::QFileDialogOptions());
|
||||
if(filename.isEmpty()) {
|
||||
// aborted selection
|
||||
return;
|
||||
}
|
||||
Preferences::getInstance().UISettings.Paths.image = QFileInfo(filename).path();
|
||||
if(filename.endsWith(".png")) {
|
||||
filename.chop(4);
|
||||
}
|
||||
filename += ".png";
|
||||
grab().save(filename);
|
||||
SaveScreenshot(this);
|
||||
});
|
||||
|
||||
auto createMarker = contextmenu->addAction("Add marker here");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue