d2phap / ImageGlass

🏞 A lightweight, versatile image viewer
https://imageglass.org
Other
7.77k stars 501 forks source link

App crash when using CROP tool on a second monitor with diferent DPI #1868

Open npn-npn opened 7 months ago

npn-npn commented 7 months ago

System information:

To Reproduce

Steps to reproduce the behavior:

  1. Open and Image on a second monitor (different DPI)
  2. Try to select "Crop" tool
  3. ImageGlass crashes (below the reported error)

Actual behavior:

Expected behavior:

Screenshots:

Additional context:

Version: ImageGlass v9.0.10.201 Release code: kobe Magick.NET: Magick.NET Q16-HDRI-OpenMP x64 netstandard21 13.5.0 WebView2 Runtime: 122.0.2365.80 OS: Microsoft Windows NT 10.0.22631.0 64-bit

Error: Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object. at ImageGlass.FrmCrop.ApplyTheme(Boolean darkMode, Nullable`1 style) in D:_GITHUB\@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 65 at ImageGlass.FrmCrop.OnDpiChanged(DpiChangedEventArgs e) in D:_GITHUB\@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 95 at System.Windows.Forms.Form.WmDpiChanged(Message& m) at ImageGlass.UI.ModernForm.WndProc(Message& m) in D:_GITHUB\@d2phap\ImageGlass\Source\Components\ImageGlass.UI\Forms\ModernForm.cs:line 200 at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

alessandro-antonelli commented 6 months ago

Probably a duplicate of #1758 ?