aelyo-softworks / Wice

Windows Interface Composition Engine is a .NET C# UI engine for creating Windows application.
Other
107 stars 5 forks source link

Do Wice support high DPI ? #4

Closed Charltsing closed 8 months ago

Charltsing commented 8 months ago

I try 125% dpi , use Wice.Samples.Gallery

125dpi

smourier commented 8 months ago

Wice kinda support Hi-Dpi in a sense that it doesn't honor it... ie: Windows and content are not resized proportionnally.

I don't have that issue though, here is a screenshot at 175% with a terminal and notepad windows for comparison

image

Charltsing commented 8 months ago

i try 175% dpi ,use the lastest Wice.Samples.Gallery.exe , Its richtextbox control displays incorrectly

my os is Windows 10 22h2

175dpi.zip

Maybe somthing is wrong in RichTextBox with High DPI.

smourier commented 8 months ago

I really can't reproduce that, here's a screenshot of my screen in 175% (w/o any DPI override applied on Wice):

image

My windows is also Windows 10 22H2 OS build 19045.3570

Charltsing commented 8 months ago

I know the cause of the problem now,need to modify advanced scaling settings-- Fix scaling for apps

cause.zip

So, how to make the software compatible with this setting?

OS also is Windows 10 22H2 , 19045.3570

捕获

smourier commented 8 months ago

That settings still doesn't change anything for me:

on: image

off: image

Charltsing commented 8 months ago

I found another problem, if i restart windows10 with 100% dpi , then change 100%-->125%, then mofify Fix scaling for apps setting, it is valid if i restart windows10 with 125% dpi ,then mofify Fix scaling for apps setting, it is invalid 11


Could you please send me the exe file and all dll files and .config file you are currently executing ? so that I can test and see if there are any differences in the file.

send to liucq@163.com or charltsing@gmail.com

thinks a lot

捕获

smourier commented 8 months ago

I have updated the Releases section https://github.com/aelyo-softworks/Wice/releases

Charltsing commented 8 months ago

i test windows 10, restart 100~125 dpi, problem is still present. win10 100~125dpi.zip

only restart win10 with 100dpi ,(if change 100% to 125% after started, Fix scaling for apps setting off ), it work fine

Charltsing commented 8 months ago

Why is the width of RTB different?

Fix scaling for apps setting is On or Off

11

Charltsing commented 8 months ago

https://learn.microsoft.com/zh-cn/dotnet/desktop/winforms/high-dpi-support-in-windows-forms I found that setting DpiAwareness and EnableWindowsFormsHighDpiAutoResizing in app. config has no effect on Wice(Disable app.manifest).

Maybe the winform controls such as RichTextBox should not be used in Wice app config app manifest

smourier commented 8 months ago

RichTextBox is not a Winforms control. Wice has no dependency over Winforms (except in some place for clipboard methods since there's no other way on Windows then use clipboard API, and Winforms wraps them easily).

The Wice RichTextBox visual does have a dependency on Windows' richedit (text services) implemented by msftedit.dll (https://learn.microsoft.com/en-us/windows/win32/api/textserv/nf-textserv-createtextservices). RTF rendering is far from being easy to implement in pure .NET.

[C:\]filever c:\Windows\System32\msftedit.dll
Language        0x0409 (English (United States))
CharSet         0x04b0 Unicode
CompanyName     Microsoft Corporation
FileDescription Rich Text Edit Control, v8.5
InternalName    MsftEdit
OriginalFilenam MsftEdit.DLL.MUI
ProductName     Microsoft« Windows« Operating System
ProductVersion  10.0.19041.1
FileVersion     10.0.19041.1 (WinBuild.160101.0800)
LegalCopyright  ⌐ Microsoft Corporation. All rights reserved.

Fixed File Info (VS_FIXEDFILEINFO) for c:\Windows\System32\msftedit.dll
        Signature:      feef04bd
        Struc Ver:      00010000
        FileVer:        00060002:4a610e34 (6.2:19041.3636)
        ProdVer:        000a0000:4a610e34 (10.0:19041.3636)
        FlagMask:       0000003f
        Flags:          00000000
        OS:             00040004 NT Win32
        FileType:       00000002 Dll
        SubType:        00000000
        FileDate:       00000000:00000000
Charltsing commented 8 months ago

it is msftedit.dll in my os 捕获 msftedit.zip

riched

riched.zip

smourier commented 8 months ago

I've tested with your msftedit (riched*.dll are not used they are legacy binaries) and it sill works:

image

Could it be the Windows regional settings/language/etc somehow? Maybe you can create a virtual machine (vhd) that reproduces the problem so I can have a look.

Charltsing commented 8 months ago

I install a english Windows10 22H2 (download from microsoft site, 2023.5.5), and insatll all online hotfix in a new PC, but problem is still present.

Start windows with 125% dpi( default Settings for Windows 10), run Wice.Samples.Gallery, after install hotfix finished I didn't do anything except above

2

so, i think maybe something have been missed

smourier commented 8 months ago

I've made a small change to the code (https://github.com/aelyo-softworks/Wice/commit/1e39a2bf7f5d2f37b75c1261665b6aa1b23b897c), bit of a shot in the dark since I've difficulties to reproduce the problem.

Charltsing commented 8 months ago

it works fine (150%DPI, Fix scaling for apps setting on) in my pc, thanks a lot!

捕获