Skip to content
Permalink
Browse files

Set the dpi default to -1 to use layout dpi

  • Loading branch information
DelazJ authored and nyalldawson committed May 26, 2018
1 parent f8bc970 commit f0b72ae62eac02dfc8251a0d69761070e3c3ce5d
@@ -54,7 +54,7 @@ are 0 based, such that the first page in a layout is page 0.
.. seealso:: :py:func:`renderRegion`
%End

QImage renderPageToImage( int page, QSize imageSize = QSize(), double dpi = 0 ) const;
QImage renderPageToImage( int page, QSize imageSize = QSize(), double dpi = -1 ) const;
%Docstring
Renders a full page to an image.

@@ -65,7 +65,7 @@ The optional ``imageSize`` parameter can specify the target image size, in pixel
It is the caller's responsibility to ensure that the ratio of the target image size
matches the ratio of the corresponding layout page size.

The ``dpi`` parameter is an optional dpi override. Set to 0 to use the default layout print
The ``dpi`` parameter is an optional dpi override. Set to -1 to use the default layout print
resolution. This parameter has no effect if ``imageSize`` is specified.

Returns the rendered image, or a null QImage if the image does not fit into available memory.
@@ -85,7 +85,7 @@ to render sections of pages rather than full pages.
.. seealso:: :py:func:`renderRegionToImage`
%End

QImage renderRegionToImage( const QRectF &region, QSize imageSize = QSize(), double dpi = 0 ) const;
QImage renderRegionToImage( const QRectF &region, QSize imageSize = QSize(), double dpi = -1 ) const;
%Docstring
Renders a ``region`` of the layout to an image. This method can be used to render
sections of pages rather than full pages.
@@ -94,7 +94,7 @@ The optional ``imageSize`` parameter can specify the target image size, in pixel
It is the caller's responsibility to ensure that the ratio of the target image size
matches the ratio of the specified region of the layout.

The ``dpi`` parameter is an optional dpi override. Set to 0 to use the default layout print
The ``dpi`` parameter is an optional dpi override. Set to -1 to use the default layout print
resolution. This parameter has no effect if ``imageSize`` is specified.

Returns the rendered image, or a null QImage if the image does not fit into available memory.
@@ -89,15 +89,15 @@ class CORE_EXPORT QgsLayoutExporter
* It is the caller's responsibility to ensure that the ratio of the target image size
* matches the ratio of the corresponding layout page size.
*
* The \a dpi parameter is an optional dpi override. Set to 0 to use the default layout print
* The \a dpi parameter is an optional dpi override. Set to -1 to use the default layout print
* resolution. This parameter has no effect if \a imageSize is specified.
*
* Returns the rendered image, or a null QImage if the image does not fit into available memory.
*
* \see renderPage()
* \see renderRegionToImage()
*/
QImage renderPageToImage( int page, QSize imageSize = QSize(), double dpi = 0 ) const;
QImage renderPageToImage( int page, QSize imageSize = QSize(), double dpi = -1 ) const;

/**
* Renders a \a region from the layout to a \a painter. This method can be used
@@ -116,15 +116,15 @@ class CORE_EXPORT QgsLayoutExporter
* It is the caller's responsibility to ensure that the ratio of the target image size
* matches the ratio of the specified region of the layout.
*
* The \a dpi parameter is an optional dpi override. Set to 0 to use the default layout print
* The \a dpi parameter is an optional dpi override. Set to -1 to use the default layout print
* resolution. This parameter has no effect if \a imageSize is specified.
*
* Returns the rendered image, or a null QImage if the image does not fit into available memory.
*
* \see renderRegion()
* \see renderPageToImage()
*/
QImage renderRegionToImage( const QRectF &region, QSize imageSize = QSize(), double dpi = 0 ) const;
QImage renderRegionToImage( const QRectF &region, QSize imageSize = QSize(), double dpi = -1 ) const;


//! Result codes for exporting layouts

0 comments on commit f0b72ae

Please sign in to comment.
You can’t perform that action at this time.