In a previous article on working with
was an example of the use of this library. But after the schedule is built, it may be necessary to make its preservation as a graphic file. QCustomPlot Library already provides methods necessary for this. All you need to do - is to create a file which will be saved and pass the path to the file in one of the methods to save the image.
Methods for saving images
saveRastered(const QString &fileName, int width, int height, double scale, const char *format, int quality)
saveJpg(const QString &fileName, int width, int height, double scale, int quality);
savePng(const QString &fileName, int width, int height, double scale, int quality);
saveBmp(const QString &fileName, int width, int height, double scale);
savePdf(const QString &fileName, bool noCosmeticPen, int width, int height, const QString &pdfCreator, const QString &pdfTitle);
It is a fundamental method for methods:
. So he called in all of these methods. Inside the method saveRastered
instance is created, through which the image is saved from
widget. For this method, you can specify the type of file to be saved. Then the remaining three methods simplify work and just write code, canceling the need to specify the file type.
This method stands alone and does not use
, and runs through
. Although the use of logic in the minimum variant is similar to the rest of the methods.