Flicker-free dimming slider for OLED models (#2109)

* Gamma Init

* Cleanup

* Show flicker-free dimming only on supported models

* Gamma ramp tweaks

* Gamma improvements

* Stronger dimming

* Added OLED model detection
This commit is contained in:
Serge
2024-02-24 11:41:41 +01:00
committed by GitHub
parent 034b46e557
commit 285cd81509
10 changed files with 408 additions and 42 deletions

View File

@@ -32,6 +32,16 @@ namespace GHelper.Display
}
internal class ScreenNative
{
[DllImport("gdi32", CharSet = CharSet.Unicode)]
internal static extern IntPtr CreateDC(string driver, string device, string port, IntPtr deviceMode);
[DllImport("gdi32")]
internal static extern bool SetDeviceGammaRamp(IntPtr dcHandle, ref GammaRamp ramp);
[DllImport("gdi32")]
internal static extern bool GetDeviceGammaRamp(IntPtr dcHandle, ref GammaRamp ramp);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct DEVMODE
{
@@ -146,7 +156,7 @@ namespace GHelper.Display
public const string defaultDevice = @"\\.\DISPLAY1";
private static string? FindInternalName(bool log = false)
public static string? FindInternalName(bool log = false)
{
try
{