0

I have a wpf app DPI aware with this code in the manifest filed:

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
        <!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>-->
        <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness>
        <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
    </windowsSettings>
  </application>

I'm using OxyPlot.Wpf to making some plot, but how can I made for the plot to be the same with any monitor and DPI configuration.

For example: enter image description here enter image description here

In the left pictures the resolution is 1920x1080 with a escale of 100% and in the right pictures the resolution is 2880x1800 with a scale of 175%.

The pictures on the right are deformed. The triangle must be equilateral triangle and the pentagon also with all of theirs side equals.

How can made to be like the pictures on the left with any monitor?

Do I have to install OxyPlot.SkiaSharp.Wpf package?

1 Answer 1

0

The problem was that my MainWindow (the container of the PlotView) has a LayoutTransform:

Me.Scrll.LayoutTransform = New ScaleTransform(ScaleX, ScaleY)

So, I put to the PlotView:

Plot.LayoutTransform = New ScaleTransform(1 / ScaleX, 1 / ScaleY)

And with that the plots are not deformed in both monitors.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.