Added method saveAsImage(QString) which will save the current map view to the filename given

git-svn-id: http://svn.osgeo.org/qgis/trunk@932 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
timlinux 2004-02-25 08:31:16 +00:00
parent 1003fcf1e4
commit ff33534a90
2 changed files with 7 additions and 2 deletions

View File

@ -312,7 +312,10 @@ void QgsMapCanvas::render()
paint->end();
*/
}
void QgsMapCanvas::saveAsImage(QString theFileName)
{
pmCanvas->save(theFileName,"PNG");
}
void QgsMapCanvas::paintEvent(QPaintEvent * ev)
{
if (!dirty)

View File

@ -105,8 +105,10 @@ class QgsMapCanvas:public QWidget
friend class QgsLegend;
public slots:
/**Sets dirty=true and calls render2()*/
void refresh();
void refresh();
void render2();
//! Save the convtents of the map canvas to disk as an image
void saveAsImage(QString theFileName);
//! This slot is connected to the visibility change of one or more layers
void layerStateChange();
//! sets z order based on order of layers in the legend