Skip to content
Permalink
Browse files

Set DPI of rendered images

  • Loading branch information
m-kuhn committed May 9, 2020
1 parent da042bb commit 83a12fb56b0478feb5b7106c91e5c184944569db
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 83a12fb

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