diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox
index 5657fe49ad..f17505ff50 100644
--- a/doc/dox/whatsnew.dox
+++ b/doc/dox/whatsnew.dox
@@ -23,6 +23,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
JKQTPlotter:
- BREAKING/REWORKED: Implement better/more access functions to the graphs (inlcuding sorting, moving up/down, appending/prepending, graphs-iterators ...), solves issue #97
+ - BREAKING/FIXED: fixed issue #96: JKQTPlotter::saveAsPixelImage() does not add a border around the image any longer (can be reacivated by a new optional function parameter), thanks to user:nmielcarek for reporting
- FIXED issue described in #62: Fix custom labels draw, because giving exactly two label-strings did not display all of them, thanks to user:FalsinSoft
- FIXED issue #70: Typo in jkqtplotter/CMakeLists.txt, thanks to user:tedlinlab
- FIXED issue #80: Bug with multiple inheritance with Q_GDAGET with CLANG, thanks to user:igormironchik, caused by QTBUG-104874
diff --git a/doc/images/errorindicators/JKQTPErrorArrows.png b/doc/images/errorindicators/JKQTPErrorArrows.png
index 9f6e1ed727..8bb284f200 100644
Binary files a/doc/images/errorindicators/JKQTPErrorArrows.png and b/doc/images/errorindicators/JKQTPErrorArrows.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorBars.png b/doc/images/errorindicators/JKQTPErrorBars.png
index 1f6b01620f..e098e085aa 100644
Binary files a/doc/images/errorindicators/JKQTPErrorBars.png and b/doc/images/errorindicators/JKQTPErrorBars.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorBarsLines.png b/doc/images/errorindicators/JKQTPErrorBarsLines.png
index c442659830..121db0ace9 100644
Binary files a/doc/images/errorindicators/JKQTPErrorBarsLines.png and b/doc/images/errorindicators/JKQTPErrorBarsLines.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorBarsPolygons.png b/doc/images/errorindicators/JKQTPErrorBarsPolygons.png
index 7f0ffe099c..1f50f44205 100644
Binary files a/doc/images/errorindicators/JKQTPErrorBarsPolygons.png and b/doc/images/errorindicators/JKQTPErrorBarsPolygons.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorBoxes.png b/doc/images/errorindicators/JKQTPErrorBoxes.png
index ee40bacc66..31a3c744ba 100644
Binary files a/doc/images/errorindicators/JKQTPErrorBoxes.png and b/doc/images/errorindicators/JKQTPErrorBoxes.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorEllipses.png b/doc/images/errorindicators/JKQTPErrorEllipses.png
index 505c217cab..b0611ab3e6 100644
Binary files a/doc/images/errorindicators/JKQTPErrorEllipses.png and b/doc/images/errorindicators/JKQTPErrorEllipses.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorHalfBarsAbove.png b/doc/images/errorindicators/JKQTPErrorHalfBarsAbove.png
index f0d7772681..d7f167c4ee 100644
Binary files a/doc/images/errorindicators/JKQTPErrorHalfBarsAbove.png and b/doc/images/errorindicators/JKQTPErrorHalfBarsAbove.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorHalfBarsBelow.png b/doc/images/errorindicators/JKQTPErrorHalfBarsBelow.png
index 2b553c322e..723a9cd9ff 100644
Binary files a/doc/images/errorindicators/JKQTPErrorHalfBarsBelow.png and b/doc/images/errorindicators/JKQTPErrorHalfBarsBelow.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorHalfBarsInwards.png b/doc/images/errorindicators/JKQTPErrorHalfBarsInwards.png
index c34df680d2..69fd27290a 100644
Binary files a/doc/images/errorindicators/JKQTPErrorHalfBarsInwards.png and b/doc/images/errorindicators/JKQTPErrorHalfBarsInwards.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorHalfBarsOutwards.png b/doc/images/errorindicators/JKQTPErrorHalfBarsOutwards.png
index f3e5da265e..7457c868ac 100644
Binary files a/doc/images/errorindicators/JKQTPErrorHalfBarsOutwards.png and b/doc/images/errorindicators/JKQTPErrorHalfBarsOutwards.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorIndicatorArrows.png b/doc/images/errorindicators/JKQTPErrorIndicatorArrows.png
index ea106a39bf..7efabc86f3 100644
Binary files a/doc/images/errorindicators/JKQTPErrorIndicatorArrows.png and b/doc/images/errorindicators/JKQTPErrorIndicatorArrows.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorIndicatorBar.png b/doc/images/errorindicators/JKQTPErrorIndicatorBar.png
index 296df2075c..b1da8d03b5 100644
Binary files a/doc/images/errorindicators/JKQTPErrorIndicatorBar.png and b/doc/images/errorindicators/JKQTPErrorIndicatorBar.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorIndicatorInwardArrows.png b/doc/images/errorindicators/JKQTPErrorIndicatorInwardArrows.png
index a8ad8e608c..5a1a443199 100644
Binary files a/doc/images/errorindicators/JKQTPErrorIndicatorInwardArrows.png and b/doc/images/errorindicators/JKQTPErrorIndicatorInwardArrows.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorInwardArrows.png b/doc/images/errorindicators/JKQTPErrorInwardArrows.png
index 068c3d702b..973cdd71c6 100644
Binary files a/doc/images/errorindicators/JKQTPErrorInwardArrows.png and b/doc/images/errorindicators/JKQTPErrorInwardArrows.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorLines.png b/doc/images/errorindicators/JKQTPErrorLines.png
index d0c7713ada..fecba975a3 100644
Binary files a/doc/images/errorindicators/JKQTPErrorLines.png and b/doc/images/errorindicators/JKQTPErrorLines.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorPolygons.png b/doc/images/errorindicators/JKQTPErrorPolygons.png
index b600220d99..b304ab44b5 100644
Binary files a/doc/images/errorindicators/JKQTPErrorPolygons.png and b/doc/images/errorindicators/JKQTPErrorPolygons.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorSimpleBars.png b/doc/images/errorindicators/JKQTPErrorSimpleBars.png
index 8c70a71ab4..bd04538762 100644
Binary files a/doc/images/errorindicators/JKQTPErrorSimpleBars.png and b/doc/images/errorindicators/JKQTPErrorSimpleBars.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorSimpleBarsLines.png b/doc/images/errorindicators/JKQTPErrorSimpleBarsLines.png
index d7373d7b9d..2aad75a847 100644
Binary files a/doc/images/errorindicators/JKQTPErrorSimpleBarsLines.png and b/doc/images/errorindicators/JKQTPErrorSimpleBarsLines.png differ
diff --git a/doc/images/errorindicators/JKQTPErrorSimpleBarsPolygons.png b/doc/images/errorindicators/JKQTPErrorSimpleBarsPolygons.png
index a9baa3fe2e..2fcd0879c1 100644
Binary files a/doc/images/errorindicators/JKQTPErrorSimpleBarsPolygons.png and b/doc/images/errorindicators/JKQTPErrorSimpleBarsPolygons.png differ
diff --git a/doc/images/errorindicators/JKQTPNoError.png b/doc/images/errorindicators/JKQTPNoError.png
index d9bff27a95..4bf897c2e9 100644
Binary files a/doc/images/errorindicators/JKQTPNoError.png and b/doc/images/errorindicators/JKQTPNoError.png differ
diff --git a/lib/jkqtplotter/jkqtpbaseplotter.cpp b/lib/jkqtplotter/jkqtpbaseplotter.cpp
index 8bda93bffb..55bacaad73 100644
--- a/lib/jkqtplotter/jkqtpbaseplotter.cpp
+++ b/lib/jkqtplotter/jkqtpbaseplotter.cpp
@@ -3970,7 +3970,7 @@ void JKQTBasePlotter::saveImage(const QString& filename, bool displayPreview) {
}
-void JKQTBasePlotter::saveAsPixelImage(const QString& filename, bool displayPreview, const QByteArray& outputFormat) {
+void JKQTBasePlotter::saveAsPixelImage(const QString& filename, bool displayPreview, const QByteArray& outputFormat, const QSize &outputSizeIncrease) {
loadUserSettings();
QString fn=filename;
QStringList filt;
@@ -3998,21 +3998,7 @@ void JKQTBasePlotter::saveAsPixelImage(const QString& filename, bool displayPrev
if (outputFormat.size()>0) {
form =outputFormat;
}
- /*if (filtID==2 || ext=="tif" || ext=="tiff") { // currentFileFormat
- form="TIFF";
- } else if (filtID==0 || ext=="png") {
- form="PNG";
- } else if (filtID==1 || ext=="bmp") {
- form="BMP";
- } else if (filtID==3 || ext=="jpg" || ext=="jpeg") {
- form="JPEG";
- } else if (ext=="ppm") {
- form="PPM";
- } else if (filtID==4 || ext=="xbm") {
- form="XBM";
- } else if (filtID==5 || ext=="xpm") {
- form="XPM";
- }*/
+
emit beforeExporting();; auto __finalpaint=JKQTPFinally([&]() { emit afterExporting();});
gridPrintingCalc();
@@ -4025,7 +4011,7 @@ void JKQTBasePlotter::saveAsPixelImage(const QString& filename, bool displayPrev
if (!displayPreview || exportpreview(gridPrintingSize, false)) {
- QImage png(QSizeF(double(printSizeX_Millimeter)*1.1, double(printSizeY_Millimeter)*1.1).toSize(), QImage::Format_ARGB32);
+ QImage png(QSizeF(double(printSizeX_Millimeter)+outputSizeIncrease.width(), double(printSizeY_Millimeter)+outputSizeIncrease.height()).toSize(), QImage::Format_ARGB32);
png.fill(Qt::transparent);
JKQTPEnhancedPainter painter;
painter.begin(&png);
diff --git a/lib/jkqtplotter/jkqtpbaseplotter.h b/lib/jkqtplotter/jkqtpbaseplotter.h
index 415b432453..1473300600 100644
--- a/lib/jkqtplotter/jkqtpbaseplotter.h
+++ b/lib/jkqtplotter/jkqtpbaseplotter.h
@@ -1728,8 +1728,14 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
* */
void setShowZeroAxes(bool showXY);
- /** \brief save the current plot as a pixel image image (PNG ...), if filename is empty a file selection dialog is displayed */
- void saveAsPixelImage(const QString& filename=QString(""), bool displayPreview=true, const QByteArray &outputFormat=QByteArray());
+ /** \brief save the current plot as a pixel image image (PNG ...), if filename is empty a file selection dialog is displayed
+ *
+ * \param filename name of the stored file, if no \a outputFormat is given, the file format is deduced by the file extension in \a filename
+ * \param displayPreview if \c true a dialog is shown that allows to modify the generated output (zoo, scaling, ...)
+ * \param outputFormmat specify the file format for the generated file
+ * \param outputSizeIncrease if given, the size of the generated pixel image is increased by this number of pixels in addition to the required space
+ */
+ void saveAsPixelImage(const QString& filename=QString(""), bool displayPreview=true, const QByteArray &outputFormat=QByteArray(), const QSize& outputSizeIncrease=QSize(0,0));
/** \brief save the current plot as a pixel image into a QImage with the given size */
QImage grabPixelImage(QSize size=QSize(), bool showPreview=false);
diff --git a/screenshots/mandelbrot.png b/screenshots/mandelbrot.png
index 79610a8100..aaad48d48b 100644
Binary files a/screenshots/mandelbrot.png and b/screenshots/mandelbrot.png differ
diff --git a/screenshots/mandelbrot_small.png b/screenshots/mandelbrot_small.png
index 3417f4584a..91e359479d 100644
Binary files a/screenshots/mandelbrot_small.png and b/screenshots/mandelbrot_small.png differ