winleafs/Winleafs

ScreenMirrorStretch algorithm Out of Bounds

Opened this issue · 2 comments

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

Hey, thanks for the report. A few questions:

  • Do you have only 1 screen or what does your complete setup look like (including scaling percentages)?
  • Which version of Winleafs are you using?
  • Could you send me your settings file? Then I can try to reproduce the error.

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