mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Merge pull request #36302 from m-kuhn/dpi_fix
Set DPI of rendered images
This commit is contained in:
commit
829e76f173
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user