示例#1
0
        public void Init()
        {
            lock (_syncLock)
            {
                _frameGrabber?.Dispose();
                _deskDupl?.Dispose();

                try
                {
                    _deskDupl = _output.DuplicateOutput(_device);

                    _frameGrabber = new FrameGrabber(_deskDupl);
                }
                catch (SharpDXException e) when(e.Descriptor == ResultCode.NotCurrentlyAvailable)
                {
                    throw new Exception(
                              "There is already the maximum number of applications using the Desktop Duplication API running, please close one of the applications and try again.",
                              e);
                }
                catch (SharpDXException e) when(e.Descriptor == ResultCode.Unsupported)
                {
                    throw new NotSupportedException(
                              "Desktop Duplication is not supported on this system.\nIf you have multiple graphic cards, try running Captura on integrated graphics.",
                              e);
                }
            }
        }