4

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.

enter image description here

1
  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq.
    – underdark
    Aug 2, 2018 at 17:49

2 Answers 2

7

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.

4

Assuming QGIS 3.x.

Project> Import/Export> Export Map to Image...

3
  • Thanks for the quick reply, but this I need to integrate into a plugin that I am creating
    – Seba79
    Aug 2, 2018 at 16:31
  • 3
    your question asks to export map to image, and this is the answer.
    – NULL.Dude
    Aug 2, 2018 at 17:10
  • I need to do this using Plugin Builder, not manually.
    – Seba79
    Aug 2, 2018 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.