Skip to content
Permalink
Browse files

Merge pull request #36302 from m-kuhn/dpi_fix

Set DPI of rendered images
  • Loading branch information
m-kuhn committed May 11, 2020
2 parents 7733448 + 83a12fb commit 829e76f1733fe5735203d6682636c1360545dd4a
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/qgsmaprendererjob.cpp
@@ -703,6 +703,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 829e76f

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