Skip to content

Commit

Permalink
WinForms: Fix thumbnail size with net9
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Aug 29, 2024
1 parent ba74dc7 commit 8be2151
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NAPS2.Lib.WinForms/EtoForms/WinForms/WinFormsHacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class WinFormsHacks

static WinFormsHacks()
{
ImageSizeField = typeof(ImageList).GetField("imageSize", BindingFlags.Instance | BindingFlags.NonPublic);
ImageSizeField = typeof(ImageList).GetField("_imageSize", BindingFlags.Instance | BindingFlags.NonPublic);
PerformRecreateHandleMethod = typeof(ImageList).GetMethod("PerformRecreateHandle", BindingFlags.Instance | BindingFlags.NonPublic);

if (ImageSizeField == null || PerformRecreateHandleMethod == null)
Expand All @@ -32,7 +32,7 @@ public static void SetImageSize(ImageList imageList, Size size)
if (ImageSizeField != null && PerformRecreateHandleMethod != null)
{
ImageSizeField.SetValue(imageList, size);
PerformRecreateHandleMethod.Invoke(imageList, new object[] { "ImageSize" });
PerformRecreateHandleMethod.Invoke(imageList, []);
}
else
{
Expand Down

0 comments on commit 8be2151

Please sign in to comment.