I'm making a complement for QGIS3, how can I export the map I'm seeing in the window to .PNG using Plugin Builder. Without having to go through Print Composers.
2 Answers
I assume you know how to create a plugin by Plugin Builder 3. If so, briefly, delete the code lines under def run(self):
line in main file of your plugin and just add the following code under def run(self):
line.
self.iface.mapCanvas().saveAsImage("your_path/file_name.png")
If you don't know how to create a plugin by Plugin Builder 3, firstly please refer to Qgis Plugin Builder page.
Assuming QGIS 3.x.
Project> Import/Export> Export Map to Image...
-
Thanks for the quick reply, but this I need to integrate into a plugin that I am creating– Seba79Aug 2, 2018 at 16:31
-
3
-