title: c#/WPF - getting DPI - matrix returning 1
body: <p>I'm writing an application using C#/WPF and I'm trying to get DPI of a screen. I'm trying to do it this way:</p>
  
  <pre><code>Window MainWindow = Application.Current.MainWindow;
  PresentationSource MainWindowPresentationSource = PresentationSource.FromVisual(MainWindow);
  Matrix m = MainWindowPresentationSource.CompositionTarget.TransformToDevice;
  MessageBox.Show(m.M11.ToString());
  </code></pre>
  
  <p>But what I get printing m.M11 is always 1. Why is that and how can I get the actual DPI (that is 96, as I suppose)?</p>