This project is read-only.

Mixed DPIs

Oct 13, 2012 at 1:57 PM

Am I right in thinking that XNA always runs at 96DPI whereas WPF adjusts to the user's DPI?

I've set up a basic blank project, and have an arbitrary WPF element (rectangle) sat over the XNA canvas (which is just the default blue). I have the XNA canvas slightly smaller than the window size.

If I run the program at the default 96DPI then all is well. If I change my DPI (Windows 7) to 125% then the XNA canvas does not paint the entire area. In terms of calculations etc. it can still read the correct screen size, but there is a big black border on two sides. I have tried everything I can think of and can't get XNA to fill the entire space. Content can still be placed there, but disappears into the unpainted black area.

I can send code if that helps - I'm pretty new to XNA so it's quite possible I'm doing something wrong, but it should be easy to reproduce. From what I understand there's no way to tell XNA to detect/update the DPI it's using?

Other than that, thanks for a fantastic library!