Пример #1
0
        private async Task StartPickerCaptureAsync()
        {
            var picker = new GraphicsCapturePicker();

            picker.SetWindow(hwnd);
            GraphicsCaptureItem item = await picker.PickSingleItemAsync();

            if (item != null)
            {
                sample.StartCaptureFromItem(item);
            }
        }
Пример #2
0
        private async Task PrepareCapture()
        {
            lbInfo.Content = "상태 : 윈도우 선택중";
            var picker = new GraphicsCapturePicker();

            picker.SetWindow(hwnd);
            GraphicsCaptureItem item = await picker.PickSingleItemAsync();

            if (item != null)
            {
                IntPtr hWnd = GethWnd(item.DisplayName);

                if (hWnd == IntPtr.Zero)
                {
                    if (MessageBox.Show("해당 윈도우는 캡쳐할 수 없습니다" + System.Environment.NewLine + "윈도우가 활성화 되어 있는지 확인해 주세요", "오류", MessageBoxButton.OK) == MessageBoxResult.OK)
                    {
                        Close();
                    }
                }
                else
                {
                    item.Closed += (s, a) =>
                    {
                        StopCapture();
                    };
                    sample.StartCaptureFromItem(item, hWnd);
                    callback();

                    lbInfo.Content = "상태 : 캡쳐 중 - " + item.DisplayName;
                }
            }
            else
            {
                Close();
            }
        }
Пример #3
0
 private void StartHwndCapture(IntPtr hwnd)
 {
     sample.StartCaptureFromItem(hwnd);
 }