Live-Charts icon indicating copy to clipboard operation
Live-Charts copied to clipboard

issuses caused by changing dpi

Open caoxiaosheng opened this issue 8 years ago • 6 comments

How to reproduce?

  1. Set Windows Dpi to 125%(The original value is 150%);
  2. Open the winforms example "Winforms.exe"
  3. Click "Labels" or any other example
  4. The form size of "Winforms.exe" becomes small

I am using

Live-Charts version *0.9.6*
.Net Version *4.5*
Windows *Win10 1607*

caoxiaosheng avatar Jun 13 '17 07:06 caoxiaosheng

I have the same problem. Did you get to fix it?

aldo-o avatar Oct 31 '17 02:10 aldo-o

@aldoblack not yet

caoxiaosheng avatar Oct 31 '17 14:10 caoxiaosheng

this is a real pain on high dpi screens... can't work in Visual Studio with this control on display.

SeniorProjectManager avatar Aug 08 '18 13:08 SeniorProjectManager

I tired to fixed this by using this code ` using System.Runtime.InteropServices; [DllImport("shcore.dll")] private static extern int SetProcessDpiAwareness(_Process_DPI_Awareness value);

    private enum _Process_DPI_Awareness
    {
        Process_DPI_Unaware = 0,
        Process_System_DPI_Aware = 1,
        Process_Per_Monitor_DPI_Aware = 2
    }

   // High resolution monitor
   SetProcessDpiAwareness(_Process_DPI_Awareness.Process_DPI_Unaware);

` But I hope there is a better way to solved this problem =(

Sourcephy avatar May 25 '19 02:05 Sourcephy

I have the same problem. However the @Sourcephy solution worked, thanks.

fabric-io-rodrigues avatar Mar 25 '20 22:03 fabric-io-rodrigues

I took me a lot of time to find our that the Live-Chart library caused the resolution issues. In VS2019, VB.NET, WinForms, W10. I solved it by modifying the app.manifest as follows:

<assemblyIdentity version="1.0.0.0"
   processorArchitecture="*"
   name="ApplicationName"
   type="win32"/>
<description>Optional description of your application</description>

<asmv3:application>
	<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
		<dpiAware>false</dpiAware>
	</asmv3:windowsSettings>
</asmv3:application>

<!-- Compatibility section -->
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
	<application>
		<!--The ID below indicates application support for Windows Vista -->
		<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
		<!--The ID below indicates application support for Windows 7 -->
		<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
		<!--This Id value indicates the application supports Windows 8 functionality-->
		<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
		<!--This Id value indicates the application supports Windows 8.1 functionality-->
		<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
		<!--This Id value indicates the application supports Windows 10 functionality-->
		<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
	</application>
</compatibility>

<!-- Trustinfo section -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
	<security>
		<requestedPrivileges>
			<requestedExecutionLevel
			   level="asInvoker"
			   uiAccess="false"/>
		</requestedPrivileges>
	</security>
</trustInfo>

<dependency>
	<dependentAssembly>
		<assemblyIdentity
           type="win32"
           name="Microsoft.Windows.Common-Controls"
           version="6.0.0.0"
           processorArchitecture="*"
           publicKeyToken="6595b64144ccf1df"
           language="*" />
	</dependentAssembly>
</dependency>
  • Make sure that dpiWare is set to false

Yafuhenk avatar Feb 03 '21 12:02 Yafuhenk