Remove uneeded DPI_VALUES array

Had forgotten to remove the uneeded DPI_VALUES array. This would have crashed the WinLibrary SetDisplayConfig process.
This commit is contained in:
Terry MacDonald 2022-06-28 11:43:18 +12:00
parent 2e18ca1832
commit 5cb653f449
3 changed files with 5 additions and 5 deletions

View File

@ -26,8 +26,8 @@ using System.Resources;
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information
[assembly: AssemblyVersion("2.4.0.62")]
[assembly: AssemblyFileVersion("2.4.0.62")]
[assembly: AssemblyVersion("2.4.0.64")]
[assembly: AssemblyFileVersion("2.4.0.64")]
[assembly: NeutralResourcesLanguageAttribute( "en" )]
[assembly: CLSCompliant(true)]

View File

@ -1105,7 +1105,7 @@ namespace DisplayMagicianShared.Windows
// Set some useful constants
public const SDC SDC_CCD_TEST_IF_VALID = (SDC.SDC_VALIDATE | SDC.SDC_USE_SUPPLIED_DISPLAY_CONFIG);
public const uint DISPLAYCONFIG_PATH_MODE_IDX_INVALID = 0xffffffff;
public static readonly UInt32[] DPI_VALUES = { 100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500 };
//public static readonly UInt32[] DPI_VALUES = { 100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500 };
// GetDisplayConfigBufferSizes

View File

@ -1549,11 +1549,11 @@ namespace DisplayMagicianShared.Windows
err = CCDImport.DisplayConfigSetDeviceInfo(ref displayScalingInfo);
if (err == WIN32STATUS.ERROR_SUCCESS)
{
SharedLogger.logger.Trace($"WinLibrary/SetWindowsDisplayConfig: Setting DPI value for source {displaySourceEntry.Value[0].SourceId} to {CCDImport.DPI_VALUES[displayScalingInfo.ScaleRel]}%.");
SharedLogger.logger.Trace($"WinLibrary/SetWindowsDisplayConfig: Setting DPI value for source {displaySourceEntry.Value[0].SourceId} to {displayScalingInfo.ScaleRel}.");
}
else
{
SharedLogger.logger.Warn($"WinLibrary/SetWindowsDisplayConfig: WARNING - Unable to set DPI value for source {displaySourceEntry.Value[0].SourceId} to {CCDImport.DPI_VALUES[displayScalingInfo.ScaleRel]}%.");
SharedLogger.logger.Warn($"WinLibrary/SetWindowsDisplayConfig: WARNING - Unable to set DPI value for source {displaySourceEntry.Value[0].SourceId} to {displayScalingInfo.ScaleRel}.");
}
}
CCDImport.SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT.DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED);