mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Gamma Init
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using WindowsDisplayAPI.Native.Structures;
|
||||
|
||||
namespace WindowsDisplayAPI.Native.DisplayConfig.Structures
|
||||
{
|
||||
// https://msdn.microsoft.com/en-us/library/vs/alm/mt622103(v=vs.85).aspx
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
internal struct DisplayConfigSupportVirtualResolution
|
||||
{
|
||||
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
|
||||
[MarshalAs(UnmanagedType.Struct)] private readonly DisplayConfigDeviceInfoHeader _Header;
|
||||
[MarshalAs(UnmanagedType.U4)] private readonly int _DisableMonitorVirtualResolution;
|
||||
|
||||
public bool DisableMonitorVirtualResolution
|
||||
{
|
||||
get => _DisableMonitorVirtualResolution > 0;
|
||||
}
|
||||
|
||||
public DisplayConfigSupportVirtualResolution(LUID adapter, uint targetId) : this()
|
||||
{
|
||||
_Header = new DisplayConfigDeviceInfoHeader(adapter, targetId, GetType(),
|
||||
DisplayConfigDeviceInfoType.GetSupportVirtualResolution);
|
||||
}
|
||||
|
||||
public DisplayConfigSupportVirtualResolution(LUID adapter, uint targetId, bool disableMonitorVirtualResolution)
|
||||
: this()
|
||||
{
|
||||
_DisableMonitorVirtualResolution = disableMonitorVirtualResolution ? 1 : 0;
|
||||
_Header = new DisplayConfigDeviceInfoHeader(adapter, targetId, GetType(),
|
||||
DisplayConfigDeviceInfoType.SetSupportVirtualResolution);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user