Fixed DisplayProfile ImageListView

I'd managed to break the Display Profile imagelistview with one of my code clearing escapades, but now I have managed to fix it again!
This commit is contained in:
Terry MacDonald 2021-09-02 15:09:06 +12:00
parent 7772b27f89
commit eef92abebf
2 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,7 @@
using DisplayMagicianShared;
using DisplayMagicianShared.NVIDIA;
using DisplayMagicianShared.AMD;
using DisplayMagicianShared.Windows;
using Manina.Windows.Forms;
using System;
using System.Collections.Generic;
@ -62,8 +65,12 @@ namespace DisplayMagician.UIForms
profileToUse = ProfileRepository.CurrentProfile;
}
// Stop the callback doing anything
Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(() => { return false; });
return profileToUse.ProfileBitmap.GetThumbnailImage(size.Width, size.Height, myCallback, IntPtr.Zero);
Image imageToUse;
imageToUse = profileToUse.ProfileBitmap.GetThumbnailImage(size.Width, size.Height, myCallback, IntPtr.Zero);
return imageToUse;
}
catch (Exception ex)
{

View File

@ -564,6 +564,12 @@ namespace DisplayMagicianShared
}
public static bool operator !=(ProfileItem lhs, ProfileItem rhs) => !(lhs == rhs);
// IMPORTANT - This ProfileItem ToString function is required to make the Profile ImageListView work properly! DO NOT DELETE!
public override string ToString()
{
return (Name ?? Language.UN_TITLED_PROFILE);
}
}
}