Git Product home page Git Product logo

desktop-duplication-cpp's Introduction

Windows Desktop Duplication Tool

This is a nifty tool to host live coding in presentations or online screen grabbers.

Two in One

Since 3.0 we have two modes of operations.

Presenter Mode

You have your IDE and private notes on your main screen. The tool only captures the code portion of this screen and shows it fullscreen on your presentation monitor or projector.

Usage Schema

Personally I use this mode to host C usergroup meetings, client meetings and professional C trainings.

Capture Area Mode

You select a portion of the screen by moving the Window around. Once you go "Live" (Context Menu or Taskbar Menu) the Window will move into the background and display whatever is displayed on top of it.

Hint: Your mouse cursors will trail if you have no window in front of it.

Personally I use this mode to share part of my screen in Jitsi, Matrix, Big Blue Button, Teams, Zoom or any other conferencing tool.

Note: As soon as you select the window again, the capture will be pause and the contents of the window will be transparent to allow repositioning of the window without flickering.

Features

By top left part of the primary screen is duplicated to a window on the right part of the same screen.

Interactions:

  • Move the window whereever you need it. Beamers for live coding and presentations.

  • Right click with your mouse to open a context menu

    • Pause / Start the screen grabbing operations

    • Select some common resolutions for your screen share window

    • Select the monitor to capture for Presenter Mode (Capture Area mode will select the monitor the window is in)

    • Switch between Presenter and Capture Area Mode

  • Double Left Mouseclick maximizes the window.

    • The entire screen is now mirroring (no window frame)

    • We prevent Windows from going to sleep mode in this presentation mode

  • The Zoom also changes captured area.

    • Ctrl + Mousewheel ↕/+/- allows you to zoom

    • CtrlShift + Mousewheel ↕ zooms in smaller steps

    • Ctrl + 0 reset zoom to 1:1

  • Moving the captured area.

    • Shift + Left Mouse Button + Dragging ⇔⇕ allows you to move the visible portion

    • Shift + /// aligns the mirrored image to the border

  • Move Window into captured area.

    • Right Mouse Button + [Focus other Window] will position and resize the other window into the mirrored area. Not all windows will like this.

  • Interactions:

    • Note: You can hover over the window icon in the taskbar and use the buttons there.

    • Shift + Right Mouse Button toggle a visualisation of the captured area

    • Ctrl + P toggle pause. Freezes the image.

The tool is optimized to be very response and save CPU time.

History

3.x - TBA

  • Your Ideas are welcome (see Contributions)

3.0-beta - 2023-12-26

  • new capture area mode

  • keep capture alive while moving or resizing the window

  • select the monitor where the capture is taken

  • capture area indicator is now fully transparent for clicks

  • added context menu

  • also show live and frozen state in capture area border colors

2.0 - 2021-01-17

  • pause / freeze feature

  • visualization of state in taskbar

  • taskbar buttons for interactions

  • mitigated the double buffering bug (last change was missing)

  • performance enhancements (less CPU und GPU required)

  • cleaned up code base (easier to start new features)

1.0 - 2017-04-16 (Revision Easter Release)

  • first public version

  • hand crafted at the Revision Demo Party

  • basic features are working

Requirements

  • DirectX 11

  • Windows 10

Build yourself

The desktop duplicator was build using QtCreator with Qbs and MSVC2019.

The only other thing you need is the DirectX and Windows and WRL headers. All included in the Windows 10 SDK.

If you have issues please ask.

License

Read the LICENSE file!

Contributions

If you have issues or questions feel free to open a ticket.

If you can answer a question in a ticket, help is appreciated.

If you like the tool, leave a star on Github and spread the love.

All usefull pull requests are welcome! If you have an idea and are unsure, please open a ticket for discussions.

Enjoy!

\0

desktop-duplication-cpp's People

Contributors

arbmind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desktop-duplication-cpp's Issues

Capture the desired window

Hello, I really like your work, you have done a great job. I have a question, is it possible to take a screenshot not of the whole desktop but just one application? Take a screenshot of the desktop and cut out the layers with unnecessary applications? I will be grateful for any answer.

Desktop Duplication Custom Output

Hello arBmind,
I try to recreate the project that you did, with the only difference, that I want to send the buffer on the network.
I would like to know if it was possible to customize the output of the frame. For example, I have my desktop which is in 1920x1080, I would like to be able to receive the buffer and dirty rect in 1280x720.
I saw that there was the SetDisplaySurface function that could be applied before running DuplicateOutput.
Here is my code:

HRESULT hr;

 hr = gDevice->QueryInterface(IID_PPV_ARGS(&gDxgiDevice));
		if (FAILED(hr))
			return;
		hr = gDxgiDevice->GetParent(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&gDxgiAdapter));
		if (FAILED(hr))
			return;
		gDxgiDevice->Release();
		UINT Output = 0;
		IDXGIOutput *lDxgiOutput = nullptr;
		hr = gDxgiAdapter->EnumOutputs(Output, &lDxgiOutput);
		if (FAILED(hr))
			return;
		gDxgiAdapter->Release();
		hr = lDxgiOutput->GetDesc(&gOutputDesc);
		if (FAILED(hr))
			return;
		IDXGIOutput1 *lDxgiOutput1 = nullptr;
		hr = lDxgiOutput->QueryInterface(IID_PPV_ARGS(&lDxgiOutput1));
		if (FAILED(hr))
			return;
		lDxgiOutput->Release();
//Is it possible to customize the output here ? With SetDisplaySurface ?
		hr = lDxgiOutput1->DuplicateOutput(gDevice, &gDeskDupl);
		if (FAILED(hr))
			return;
		lDxgiOutput1->Release();
		gDeskDupl->GetDesc(&gOutputDuplDesc);

Is it possible for you to help me?
Thanks a lot

Capture windowed apps

Great project,

I would like to capture windowed apps. All the sample I see talks about DXGI capturing the full desktop. So, is DXGI capable to do it? Any advice to do it?

Black output

I compiled this repository in Visual Studio Professional 2017.

The only difference being, I switched all paths in desktop-duplication.vcxproj from Community to Professional.
It compiles just fine. Running the program gives me the following black display.

image

Do you have an idea what can be causing this issue ?

Setup Visual Studio Project

Hi @arBmind,

thanks a lot for this great tool. I am using it for sharing just a part of my screen in MS-Teams Meetings. To further customize the tool to my needs, I want to add a few changes. Unfortunately, I am not able to set up the Project in Visual Studio 2019 (Professional).

I have already installed the Windows 10 SDK and used the clang Toolset, but I receive the following Error-message:

'''
....\src\BaseRenderer.cpp(5,10): fatal error : 'PlainPixelShader.h' file not found
'''

Therefore, I suspect something is still wrong with my include directories. Since I am not very experienced with Direct-X development, I appreciate any tips. Thanks a lot for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.