sizeresolution-independence

WPF how to get the same visual size in different devices


I'm making a WPF program. I'm working on my desktop. I found the real sizes of elements are different when I ran the program on my laptop. I want to make it get the same visual size on my laptop as I saw on my desktop. Each resolution of two devices is same each other(1920 x 1080).

I attached an image for you to understand this situation quickly. Red-outlined one is from my desktop, and the other one is from my laptop.

The image is below instead of the real image. I'm newbie in stackoverflow sorry.

image


Solution

  • I found the problem. My laptop's DPI was 1.25 times as my desktop's. I adjusted the DPI of my laptop to 1/96. Solved.