Hi Tom

On Fri, Jul 1, 2016 at 5:25 PM, Tom Chadwin <[email protected]> wrote:
> Hi Martin
>
>
> Martin Dobias wrote
>>>>> iface.mapCanvas().geometry()
>> PyQt4.QtCore.QRect(0, 0, 879, 390)
>>>>> iface.mapCanvas().viewport().geometry()
>> PyQt4.QtCore.QRect(3, 3, 873, 384)
>
> Ah, OK! I didn't know anything about a canvas frame. So, without doing
> setFrameStyle(), does canvas.extent() give canvas.geometry() or
> canvas.viewport().geometry()?

With the frame, canvas.extent() is linked to size reported by
cavas.viewport().geometry().

Even better is to use canvas.mapSettings().outputSize() that gives you
the actual image size used for rendering (although it should be the
same as the size from canvas.viewport().geometry()).

Cheers
Martin
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to