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; }
public ImageCapture(Size targetScreenBoundsSize, int interval = 500) { if (!ScreenUtility.EqualsScreenBoundsSize(targetScreenBoundsSize)) { throw new ArgumentException(nameof(targetScreenBoundsSize)); } if (!(interval >= 500 && interval <= 3000)) { throw new ArgumentException(nameof(interval) + " 값 범위는 500-3000 입니다."); } TargetScreenBoundsSize = targetScreenBoundsSize; TargetScreen = new MultiScreen(TargetScreenBoundsSize).TargetScreen; if (TargetScreen == null) { throw new InvalidOperationException("TargetScreen 이 null 입니다."); } TargetScreenIndex = InvalidScreenIndex; _interval = interval; }