Skip to content

Commit a1cfcd4

Browse files
ShahzaibIbrahimHeikoKlare
authored andcommitted
Added documentation about SWT's Autoscale methods
This PR adds the documentation about SWT's Autoscale methods and their behavior
1 parent a7290ba commit a1cfcd4

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

docs/hidpi-support.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# HiDPI Support in SWT
2+
3+
This document (incompletely) describes certain parts of the HiDPI support in SWT for all platforms (Windows, MacOS, GTK).
4+
5+
## Table of Contents
6+
7+
1. [Autoscale Methods](#autoscale-Methods)
8+
9+
### Autoscale Methods
10+
11+
The `swt.autoScale.method` system property controls the method used to determine how to handle scaling of Images in SWT:
12+
13+
- **`smooth`**
14+
15+
- Uses anti-aliased / bilinear interpolation
16+
- Smooth edges, may appear slightly blurry
17+
18+
- **`nearest`**
19+
20+
- Uses nearest-neighbor interpolation
21+
- Edges appear jagged or blocky
22+
23+
24+
**Example usage:** To configure the smooth scaling, set the system property to one of the above, e.g. *-Dswt.autoScale.method=smooth*
25+
26+
**Default Behavior**:
27+
28+
- `GTK`: Uses smooth scaling only when deviceZoom is an integer multiple of 100% (100%, 200%, …). Otherwise, SWT falls back to nearest.
29+
- `Windows`: Uses smooth scaling only if monitor-specific DPI scaling is enabled (Per-Monitor DPI awareness). Otherwise, SWT uses nearest.
30+
- `MacOS`: Never uses smooth scaling.

0 commit comments

Comments
 (0)