You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app that sits in the background and updates the notify icon periodically. This app runs into the following GDI+ exception after running an arbitrary amount of time:
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at Windows.Win32.Graphics.GdiPlus.StatusExtensions.ThrowIfFailed(Status status)
at System.Drawing.Bitmap.GetHicon()
at Wpf.Ui.Tray.Hicon.FromSource(ImageSource source)
at Wpf.Ui.Tray.TrayManager.ReloadHicon(INotifyIcon notifyIcon)
at Wpf.Ui.Tray.TrayManager.ModifyIcon(INotifyIcon notifyIcon)
at Wpf.Ui.Tray.Internal.InternalNotifyIconManager.ModifyIcon()
at Wpf.Ui.Tray.Controls.NotifyIcon.OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Wpf.Ui.Tray.Controls.NotifyIcon.set_Icon(ImageSource value)
Describe the bug
I have an app that sits in the background and updates the notify icon periodically. This app runs into the following GDI+ exception after running an arbitrary amount of time:
To Reproduce
Sample code to reproduce the issue:
XAML
C#
The error would occur when the loop is running up to around 4000.
Expected behavior
Changing the notify icon shouldn't cause the GDI+ exception over time.
Screenshots
No response
OS version
Windows 11 24H2 26100.2454
.NET version
.NET 9.0
WPF-UI NuGet version
WPF-UI.Tray 3.0.5
Additional context
No response
The text was updated successfully, but these errors were encountered: