unvell / ReoGrid

Fast and powerful .NET spreadsheet component, support data format, freeze, outline, formula calculation, chart, script execution and etc. Compatible with Excel 2007 (.xlsx) format and working on .NET 3.5 (or client profile), WPF and Android platform.
https://reogrid.net
MIT License
1.33k stars 394 forks source link

Cell size not right on high DPI device #446

Closed xuqiang1015 closed 1 year ago

xuqiang1015 commented 2 years ago

ReoGrid is great Control, thanks to everybody who works on it!

Now I tried to use ReoGrid(WinForm version) in my MFC program.

My screen DPI is 200%, cell height is 20 by default, so cell height should be 40 pixcel.

It works fine when I use ReoGrid in winform.

But when I intergate ReoGrid into MFC, cell height turns to be 20 pixcel.

I didn't find the right solution for it.

Anyone konw how to solve it ? Thanks for you help!

My test code is here.

Which edition of ReoGrid is targeted

xuqiang1015 commented 2 years ago

I found the reason. ReoGrid does not surpport DPI Aware yet.

I've modified my test code, make the Winform project DPI Aware. Now cells in WinForm project is not right too.

When project is DPI Unaware, cell and font have been scaled by system, so the size is right, but turns into blurry.

These are images to compare under DPI Aware and DPI Unaware mod:

DPI Aware:

DPI 200 aware

DPI Unaware:

DPI 200 Unaware

Origin Images are here : DPI Aware DPI Unaware

xuqiang1015 commented 2 years ago

fixed in pull request

jingwood commented 1 year ago

Thank you very much!