mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
9e1ef4a095
Installer works, but there are a few issues with it. - It doesn't register the DesktopBackground COM server - It doesn't create a start menu shortcut with the AUMID - It doesn't check for .Net Framework 4.8 or later - It doesn't try to install .Net Framework 4.8 or later if not there - It doesn't have any customised backgrounds... - It doesn't ask to run DisplayMagician when install is finished
96 lines
2.2 KiB
C#
96 lines
2.2 KiB
C#
using NvAPIWrapper.Native.Display;
|
|
using NvAPIWrapper.Native.Mosaic;
|
|
|
|
namespace DisplayMagicianShared.NVIDIA
|
|
{
|
|
internal static class SurroundHelper
|
|
{
|
|
public static PixelShift ToPixelShift(this PixelShiftType pixelShift)
|
|
{
|
|
switch (pixelShift)
|
|
{
|
|
case PixelShiftType.TopLeft2X2Pixels:
|
|
|
|
return PixelShift.TopLeft2X2Pixels;
|
|
|
|
case PixelShiftType.BottomRight2X2Pixels:
|
|
|
|
return PixelShift.BottomRight2X2Pixels;
|
|
|
|
default:
|
|
|
|
return PixelShift.NoPixelShift;
|
|
}
|
|
}
|
|
|
|
public static PixelShiftType ToPixelShiftType(this PixelShift pixelShift)
|
|
{
|
|
switch (pixelShift)
|
|
{
|
|
case PixelShift.TopLeft2X2Pixels:
|
|
|
|
return PixelShiftType.TopLeft2X2Pixels;
|
|
|
|
case PixelShift.BottomRight2X2Pixels:
|
|
|
|
return PixelShiftType.BottomRight2X2Pixels;
|
|
|
|
default:
|
|
|
|
return PixelShiftType.NoPixelShift;
|
|
}
|
|
}
|
|
|
|
public static Rotate ToRotate(this Rotation rotation)
|
|
{
|
|
switch (rotation)
|
|
{
|
|
case Rotation.Identity:
|
|
|
|
return Rotate.Degree0;
|
|
|
|
case Rotation.Rotate90:
|
|
|
|
return Rotate.Degree90;
|
|
|
|
case Rotation.Rotate180:
|
|
|
|
return Rotate.Degree180;
|
|
|
|
case Rotation.Rotate270:
|
|
|
|
return Rotate.Degree270;
|
|
|
|
default:
|
|
|
|
return Rotate.Ignored;
|
|
}
|
|
}
|
|
|
|
public static Rotation ToRotation(this Rotate rotation)
|
|
{
|
|
switch (rotation)
|
|
{
|
|
case Rotate.Degree0:
|
|
|
|
return Rotation.Identity;
|
|
|
|
case Rotate.Degree90:
|
|
|
|
return Rotation.Rotate90;
|
|
|
|
case Rotate.Degree180:
|
|
|
|
return Rotation.Rotate180;
|
|
|
|
case Rotate.Degree270:
|
|
|
|
return Rotation.Rotate270;
|
|
|
|
default:
|
|
|
|
return Rotation.Unknown;
|
|
}
|
|
}
|
|
}
|
|
} |