/// <summary> /// /// </summary> /// <param name="targetScreenIndex">타겟이 되는 스크린 인덱스</param> /// <exception cref="System.InvalidOperationException"></exception> public MultiScreen(int targetScreenIndex) { if (Screen.AllScreens.Length == 1) { throw new InvalidOperationException("Screen.AllScreens.Length==1"); } if (!ScreenUtility.IsValidIndex(targetScreenIndex)) { throw new ArgumentException(nameof(targetScreenIndex)); } TargetScreenIndex = targetScreenIndex; TargetScreenBoundsSize = Size.Empty; }
public ImageCapture(int targetScreenIndex, int interval = 500) { if (!ScreenUtility.IsValidIndex(targetScreenIndex)) { throw new ArgumentException(nameof(targetScreenIndex) + " 값 범위는 0-" + (Screen.AllScreens.Length - 1) + " 입니다."); } if (!(interval >= 500 && interval <= 3000)) { throw new ArgumentException(nameof(interval) + " 값 범위는 500-3000 입니다."); } TargetScreenIndex = targetScreenIndex; TargetScreen = new MultiScreen(TargetScreenIndex).TargetScreen; if (TargetScreen == null) { throw new InvalidOperationException("TargetScreen 이 null 입니다."); } TargetScreenBoundsSize = Size.Empty; _interval = interval; }