[Qgis-user] how to invoke the save as image from the python console

2011-10-07 Thread Rhys A.D. Stewart
Greetings,

hoping for a quick answer before i go diving through the API. is there
a quick way to invoke the save as image dialogue from the console? o
have a list of coordinates and would like to zoom in and get an image
of each area around the coords? But since i have about 250 or so
coords am not too keen on doing it manually...so then i really
dont want the save as image box to come up really i want the
functionality from the console.


Thanks

Rhys Stewart
Peace  Love|Live Long  Prosper
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] how to invoke the save as image from the python console

2011-10-07 Thread Martin Dobias
On Fri, Oct 7, 2011 at 12:05 PM, Rhys A.D. Stewart
rhys.stew...@gmail.com wrote:
 Greetings,

 hoping for a quick answer before i go diving through the API. is there
 a quick way to invoke the save as image dialogue from the console? o
 have a list of coordinates and would like to zoom in and get an image
 of each area around the coords? But since i have about 250 or so
 coords am not too keen on doing it manually...so then i really
 dont want the save as image box to come up really i want the
 functionality from the console.

You can directly use QgsMapRenderer class to render the map to
whatever target - in your case it would be a QImage that you can save
to a file. PyQGIS cookbook gives an example how to construct and use
map renderer. If you are going to use map canvas contents you may take
advantage of map renderer from map canvas (
qgis.utils.iface.mapCanvas().mapRenderer() ) and only change extents
and trigger the rendering.

[1] http://www.qgis.org/pyqgis-cookbook/composer.html

Martin
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user