Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set DPI of rendered images
(cherry picked from commit 83a12fb)
  • Loading branch information
m-kuhn authored and nyalldawson committed Jun 19, 2020
1 parent f5a71c0 commit a2b06f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/qgsmaprendererjob.cpp
Expand Up @@ -473,6 +473,8 @@ QImage QgsMapRendererJob::composeImage( const QgsMapSettings &settings, const La
{
QImage image( settings.deviceOutputSize(), settings.outputImageFormat() );
image.setDevicePixelRatio( settings.devicePixelRatio() );
image.setDotsPerMeterX( static_cast<int>( settings.outputDpi() * 39.37 ) );
image.setDotsPerMeterY( static_cast<int>( settings.outputDpi() * 39.37 ) );
image.fill( settings.backgroundColor().rgba() );

QPainter painter( &image );
Expand Down

0 comments on commit a2b06f4

Please sign in to comment.