LuciadCPillar views support High-DPI rendering for map navigation and map view properties (such as fitting to the toolkit canvas).

Note that icons, line widths and font sizes are not be scaled up.

LuciadCPillar has two coordinate concepts for HiDPI support:

  • Toolkit coordinates correspond to screen pixels that have been scaled by the DPI scale of the platform or the operating system.

  • Screen coordinates correspond to the actual physical pixels of the view.

If toolkit coordinates are defined as 1024 x 768 pixels and the DPI scale is 200%, then the actual screen coordinates will be 2048x1536. (toolkit_pixels == screen_pixels / dpi_scale )

LuciadCPillar can be integrated into any OpenGL-capable UI toolkit. The UI toolkit should express its dimensions and locations in both coordinates. The ratio between these two sizes is equal to the DPI scale value. All LuciadCPillar samples are configured to be High-DPI-aware and ready to be used. See the appropriate integration sample for your UI toolkit.

Mouse input events received by a controller may contain a position expressed in toolkit coordinates. On systems that use DPI scaling, those may not correspond to LuciadCPillar view coordinates. If you need to transform the cursor position to a geographic location, for instance, you need to be aware of this difference. Mouse coordinates must be updated according to the DPI scale.

Program (C++): Scaling mouse coordinates
auto position = Coordinate{static_cast<double>(event->pos().x() * _owner->window()->devicePixelRatio()),
                           static_cast<double>(event->pos().y() * _owner->window()->devicePixelRatio())};