Hi Raymond,

On Thu, 05. Jul 2018 at 16:53:21 +0200, Raymond Nijssen wrote:
> Can anyone provide a working example for exporting maps to png files?

Probably not a nice example for the cookbook, but this does the job and even
works alike on 2 and 3 (essentially what QgisApp::saveAsImage does):

c = iface.mapCanvas()
pm = QPixmap(c.width(), c.height())
c.saveAsImage("/tmp/foo.png", pm)


Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
Software Engineer           D-26506 Norden             http://www.norbit.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to