Unsolved How can I used QPrinter with QPrinter::HighResolution to save png file
-
How can I used QPrinter with QPrinter::HighResolution to save png file
-
Hi,
more convenient way would be to use i.e. QImage::save() if you think png. QPrinter might be convenient when you wish for pdf.
However to completely answer your question please refer to QPrinter documentation - you could print on QPainter and then use it together with QPicture or other format to save the data as png. -
Since I tried it did not work .could you write a sample code
What does QPrinter::HighResolution does . how does it increases the levelOfDetail in QGraphicsView
-
@Qt-Enthusiast said in How can I used QPrinter with QPrinter::HighResolution to save png file:
Since I tried it did not work
What did you try? What did not work?
QPrinter::HighResolution: http://doc.qt.io/qt-5/qprinter.html
"On Windows, sets the printer resolution to that defined for the printer in use. For PDF printing, sets the resolution of the PDF driver to 1200 dpi." -
but I can save the image in png format with
QPrinter printer(QPrinter::HighResolution);
printer.setCreator(PRODUCT_NAME);
printer.setOutputFileName(nm);
QPainter painter(&printer);
render(&painter);Please let me know what I am missing
-
@Qt-Enthusiast I'm lost now. It is really hard to understand your questions.
Why do you try to save image using QPrinter?! Why don't you do it as @artwaw suggested?
"Please let me know what I am missing" - you should store images like @artwaw suggested not via QPrinter...