public IEditableFrame Capture()
        {
            foreach (var entry in _outputs)
            {
                try
                {
                    if (!entry.DuplCapture.Get(_editorSession.DesktopTexture, entry.MousePointer, entry.Location))
                    {
                        return(RepeatFrame.Instance);
                    }
                }
                catch
                {
                    try { entry.DuplCapture.Init(); }
                    catch
                    {
                        // ignored
                    }

                    return(RepeatFrame.Instance);
                }
            }

            var editor = new Direct2DEditor(_editorSession);

            foreach (var entry in _outputs)
            {
                entry.MousePointer?.Draw(editor, entry.Location);
            }

            return(editor);
        }
Example #2
0
        public IEditableFrame Capture()
        {
            try
            {
                if (!_duplCapture.Get(_editorSession.DesktopTexture, _mousePointer))
                {
                    return(RepeatFrame.Instance);
                }
            }
            catch
            {
                try { _duplCapture.Init(); }
                catch
                {
                    // ignored
                }

                return(RepeatFrame.Instance);
            }

            var editor = new Direct2DEditor(_editorSession);

            _mousePointer?.Draw(editor);

            return(editor);
        }
Example #3
0
        public void Draw(Direct2DEditor editor)
        {
            if (!_pointerPosition.Visible)
            {
                return;
            }

            var bitmap = _pointerShape?.GetBitmap();

            if (bitmap == null)
            {
                return;
            }

            var rect = new Rectangle(_pointerPosition.Position.X,
                                     _pointerPosition.Position.Y,
                                     (int)bitmap.Size.Width,
                                     (int)bitmap.Size.Height);

            editor.DrawImage(bitmap, rect);
        }
Example #4
0
        public void Draw(Direct2DEditor Editor, Point Location = default)
        {
            if (!_pointerPosition.Visible)
            {
                return;
            }

            var bmp = _pointerShape?.GetBitmap();

            if (bmp == null)
            {
                return;
            }

            var rect = new Rectangle(_pointerPosition.Position.X + Location.X,
                                     _pointerPosition.Position.Y + Location.Y,
                                     (int)bmp.Size.Width,
                                     (int)bmp.Size.Height);

            Editor.DrawImage(new Direct2DImage(bmp), rect);
        }