Skip to content

Commit

Permalink
多屏DPI不一样,导致不能铺满问题
Browse files Browse the repository at this point in the history
  • Loading branch information
GiantappMan committed May 13, 2021
1 parent eb53a3e commit 1dd201c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions LiveWallpaper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace LiveWallpaper
class Program
{
[STAThread]
static void Main(string[] args)
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
Application.Run(new AppContext());
}
}
Expand Down
2 changes: 1 addition & 1 deletion LiveWallpaperEngineAPI/Forms/LiveWallpaperRenderForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Giantapp.LiveWallpaper.Engine.Forms
/// </summary>
public partial class LiveWallpaperRenderForm : Form
{
static readonly Dictionary<string, LiveWallpaperRenderForm> _hosts = new Dictionary<string, LiveWallpaperRenderForm>();
static readonly Dictionary<string, LiveWallpaperRenderForm> _hosts = new();
readonly string _screenName;

public LiveWallpaperRenderForm(string screenName)
Expand Down
4 changes: 2 additions & 2 deletions LiveWallpaperEngineAPI/Utils/WallpaperHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class WallpaperHelper
#region static

//Dictionary<screenName,helper>
static readonly Dictionary<string, WallpaperHelper> _cacheInstances = new Dictionary<string, WallpaperHelper>();
static readonly Dictionary<string, WallpaperHelper> _cacheInstances = new();
static IDesktopWallpaper _desktopWallpaperAPI;
static uint _slideshowTick;
static IntPtr _progman;
Expand Down Expand Up @@ -54,7 +54,7 @@ public static void RestoreDefaultWallpaper()
static string GetDesktopWallpaper()
{
int MAX_PATH = 260;
string wallpaper = new string('\0', MAX_PATH);
string wallpaper = new('\0', MAX_PATH);
_ = User32Wrapper.SystemParametersInfo(User32Wrapper.SPI_GETDESKWALLPAPER, (uint)wallpaper.Length, wallpaper, 0);
return wallpaper.Substring(0, wallpaper.IndexOf('\0'));
}
Expand Down

0 comments on commit 1dd201c

Please sign in to comment.