QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
QgsLayoutExporter::ImageExportSettings Struct Reference

Contains settings relating to exporting layouts to raster images. More...

#include <qgslayoutexporter.h>

Public Member Functions

 ImageExportSettings ()
 

Public Attributes

QgsMargins cropMargins
 Crop to content margins, in pixels.
 
bool cropToContents = false
 Set to true if image should be cropped so only parts of the layout containing items are exported.
 
double dpi = -1
 Resolution to export layout at. If dpi <= 0 the default layout dpi will be used.
 
bool exportMetadata = true
 Indicates whether image export should include metadata generated from the layout's project's metadata.
 
QgsLayoutRenderContext::Flags flags = QgsLayoutRenderContext::Flags()
 Layout context flags, which control how the export will be created.
 
bool generateWorldFile = false
 Set to true to generate an external world file alongside exported images.
 
QSize imageSize
 Manual size in pixels for output image.
 
QList< int > pages
 List of specific pages to export, or an empty list to export all pages.
 
QVector< qreal > predefinedMapScales
 A list of predefined scales to use with the layout.
 
int quality = -1
 Image quality, typically used for JPEG compression (whose quality ranges from 1 to 100) if quality is set to -1, the default quality will be used.
 

Detailed Description

Contains settings relating to exporting layouts to raster images.

Definition at line 167 of file qgslayoutexporter.h.

Constructor & Destructor Documentation

◆ ImageExportSettings()

QgsLayoutExporter::ImageExportSettings::ImageExportSettings ( )
inline

Definition at line 169 of file qgslayoutexporter.h.

Member Data Documentation

◆ cropMargins

QgsMargins QgsLayoutExporter::ImageExportSettings::cropMargins

Crop to content margins, in pixels.

These margins will be added to the bounds of the exported layout if cropToContents is true.

Definition at line 200 of file qgslayoutexporter.h.

◆ cropToContents

bool QgsLayoutExporter::ImageExportSettings::cropToContents = false

Set to true if image should be cropped so only parts of the layout containing items are exported.

Definition at line 194 of file qgslayoutexporter.h.

◆ dpi

double QgsLayoutExporter::ImageExportSettings::dpi = -1

Resolution to export layout at. If dpi <= 0 the default layout dpi will be used.

Definition at line 174 of file qgslayoutexporter.h.

◆ exportMetadata

bool QgsLayoutExporter::ImageExportSettings::exportMetadata = true

Indicates whether image export should include metadata generated from the layout's project's metadata.

Since
QGIS 3.2

Definition at line 223 of file qgslayoutexporter.h.

◆ flags

QgsLayoutRenderContext::Flags QgsLayoutExporter::ImageExportSettings::flags = QgsLayoutRenderContext::Flags()

Layout context flags, which control how the export will be created.

Definition at line 229 of file qgslayoutexporter.h.

◆ generateWorldFile

bool QgsLayoutExporter::ImageExportSettings::generateWorldFile = false

Set to true to generate an external world file alongside exported images.

Definition at line 215 of file qgslayoutexporter.h.

◆ imageSize

QSize QgsLayoutExporter::ImageExportSettings::imageSize

Manual size in pixels for output image.

If imageSize is not set then it will be automatically calculated based on the output dpi and layout size.

If cropToContents is true then imageSize has no effect.

Be careful when specifying manual sizes if pages in the layout have differing sizes! It's likely not going to give a reasonable output in this case, and the automatic dpi-based image size should be used instead.

Definition at line 188 of file qgslayoutexporter.h.

◆ pages

QList< int > QgsLayoutExporter::ImageExportSettings::pages

List of specific pages to export, or an empty list to export all pages.

Page numbers are 0 index based, so the first page in the layout corresponds to page 0.

Definition at line 209 of file qgslayoutexporter.h.

◆ predefinedMapScales

QVector<qreal> QgsLayoutExporter::ImageExportSettings::predefinedMapScales

A list of predefined scales to use with the layout.

This is used for maps which are set to the predefined atlas scaling mode.

Since
QGIS 3.10

Definition at line 236 of file qgslayoutexporter.h.

◆ quality

int QgsLayoutExporter::ImageExportSettings::quality = -1

Image quality, typically used for JPEG compression (whose quality ranges from 1 to 100) if quality is set to -1, the default quality will be used.

Since
QGIS 3.42

Definition at line 244 of file qgslayoutexporter.h.


The documentation for this struct was generated from the following file: