Touch/Stylus pen drawing on WPF InkCanvas is not DPI Aware.
See original GitHub issue- .NET Core Version: Not tested
- Windows version: (
winver
) 1909 or later - Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
- Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc…)? No
Problem description: When Per Monitor DPI Awareness is enabled, Ink Strokes with touch/Stylus pen on WPF InkCanvas are drawn wrong scale/position after monitor DPI changed.
Per Monitor DPI Awareness works well with touch/stylus pen for button click, element dragging on Canvas, and so on. However, InkCanvas may not aware DPI change and follow primay screen scale.
Actual behavior:
Mouse drawing works correctly but, Inks with Touch/stylus pen are drawn to incorrect position/size after MainWindow is moved to extended monitor with different scale.
Expected behavior:
Inks with Touch/stylus pen must be drawn to correct position/size after MainWindow is moved to extended monitor with different scale.
Minimal repro:
The issue can be reproduce as the following step (two monitors are required).
- Create a WPF application (.NET Framework 4.0~4.8)
- Add a InkCanvas control in MainWindow.
- Set Per Monitor DPI Awareness setting as https://github.com/microsoft/WPF-Samples/tree/main/PerMonitorDPI
- Set the scale of each monitor with different value like 100% for Display1 and 125% for Display2.
- Run the application and move window to extended monitor.
- Draw inks with mouse/touch/stylus pen.
- Mouse strokes are correct but touch/stylue pen strokes are not correct (the stroke points may be scaled according to the difference between monitor scales.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top GitHub Comments
@lindexi - Fixes on .NET Framework will be limited to security vulnerabilities or bugs that are filed as DTS issues.
@jheraldP Sorry, I don’t know.
@singhashish-wpf Could I ask you it will be merged on .NET Framework 4.8?