Skip to content
Permalink
Browse files

Set DPI of rendered images

(cherry picked from commit 83a12fb)
  • Loading branch information
m-kuhn authored and nyalldawson committed May 9, 2020
1 parent f5a71c0 commit a2b06f45cfc2c01d5ccfb200aa222fdfed283e17
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/qgsmaprendererjob.cpp
@@ -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 );

0 comments on commit a2b06f4

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