winleafs / Winleafs

Winleafs: Windows application for Nanoleaf lights
GNU General Public License v3.0
86 stars 9 forks source link

ScreenMirrorStretch algorithm Out of Bounds #195

Open Svenyie opened 3 years ago

Svenyie commented 3 years ago

When selecting the stretch algorithm my shapes won't work. after looking in the log i found this error. Fit or Ambilight does work.

screenres: 3840x1080

2021-07-22 01:12:45.8995|ERROR|Winleafs.Wpf.Api.Effects.ScreenMirrorEffect|Unexpected error for screen mirror with algorithm ScreenMirrorStretch
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Winleafs.Wpf.Helpers.ScreenGrabber.CalculateAverageColor(IEnumerable`1 areasToCapture, Int32 minDiversion) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Helpers\ScreenGrabber.cs:line 104
   at Winleafs.Wpf.Api.Effects.ScreenMirrorEffects.ScreenMirror.ApplyEffect() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Effects\ScreenMirrorEffects\ScreenMirror.cs:line 65
   at Winleafs.Wpf.Api.Effects.ScreenMirrorEffect.ApplyEffect() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Effects\ScreenMirrorEffect.cs:line 90
StijnOostdam commented 3 years ago

Hey, thanks for the report. A few questions:

Svenyie commented 3 years ago

2 screens : main monitor (this is the monitor i want to use for screen mirror) 3840x1080 100% scaling secondary monitor (screen mirror stretch works if i select this monitor) 1920x1080 100% scaling

version 1.1.8

Settings.txt