# High-DPI scaling issues

**URL:** <https://discourse.vtk.org/t/high-dpi-scaling-issues/7693>\
**Category:** Development\
**Created:** [January 20, 2022, 6:23pm UTC](https://discourse.vtk.org/t/high-dpi-scaling-issues/7693 "2022-01-20T18:23:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drpeterfranz](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@drpeterfranz](https://discourse.vtk.org/u/drpeterfranz)\
**Post date:** [January 20, 2022, 6:23pm UTC](https://discourse.vtk.org/t/high-dpi-scaling-issues/7693/1 "2022-01-20T18:23:41Z")

</div>

Hi there,

I am trialling out a new 4k display. Moving over from 1920x1080 to 3840x2040 of course results in tiny fonts etc, so I am using my system’s desktop scaling mechanism to so that everything is scaled by a factor of 2.

Most of the things in VTK I am working with work quite well with this, but I have some small issues where objects don’t apply the scaling correctly. The ones which I have identified so far are:

- `vtkCubeAxesActor` uses incorrect font scaling
- `vtkAxis` creates the wrong number of ticks/labels
- `vtkPlotLine` uses wrong marker sizes and line widths

I’ll try to attach two screenshots below showing the effects of `vtkAxis` and `vtkPlotLine`.

I’m happy to have a go at fixing these issues, but need some pointers. How does VTK detect scaling factors, and are there some examples on how they are applied to classes?

**Normal HD, no scaling:**

 ![cell-normal-dpi](https://discourse.vtk.org/uploads/default/original/2X/8/8af8df6541069045b0aa4c48e9e4eb2bebe71c2c.png)

**High DPI, with system-wide scaling set:**

 ![cell-high-dpi-scaled](https://discourse.vtk.org/uploads/default/original/2X/c/c6b6042ff60d8d245e2d0611d378e689e8356926.png)

---

<div class="post-metadata">

**Author:** ![drpeterfranz](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@drpeterfranz](https://discourse.vtk.org/u/drpeterfranz)\
**Post date:** [January 24, 2022, 4:05am UTC](https://discourse.vtk.org/t/high-dpi-scaling-issues/7693/2 "2022-01-24T04:05:47Z")

</div>

So is there a way that I can determine the display scaling factor from within a `Paint()` method?

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [January 24, 2022, 3:00pm UTC](https://discourse.vtk.org/t/high-dpi-scaling-issues/7693/3 "2022-01-24T15:00:22Z")

</div>

There’s no method to get the display scaling factor, but you can get the DPI:

```auto
int dpi = renderWindow->GetDPI();

```

The DPI is generally equal to 72 times the display scaling factor.
