Comments (4)
Unfortunately, I'm unable to reproduce the issue. Your code works fine for me, assuming your version of CreateD3DDevice
returns a valid IDirect3DDevice
. I've modified that part to use robmikh.common:
#include <robmikh.common/d3dHelpers.h>
#include <robmikh.common/direct3d11.interop.h>
namespace util
{
using namespace robmikh::common::uwp;
}
// ...
auto d3dDevice = util::CreateD3DDevice();
auto device = CreateDirect3DDevice(d3dDevice.as<IDXGIDevice>().get());
// ...
auto framePool = winrt::Direct3D11CaptureFramePool::Create(device, pixelFormat, 2, itemSize);
Do you have a complete minimal repro on GitHub I could look at? I'm assuming the Win32CaptureSample works on the same machine?
from win32capturesample.
I'm so burned out on this. I'll try to put something together. The problem with your libs is that as a console app, it doesn't compile.
It complains about a whole lot of stuff being undefined. I wanted to put together a main.cpp, without a million header files, that is a very simple start to finish all in one example.
I even tried to build this: https://github.com/microsoft/PowerToys/tree/main/src/modules/MeasureTool/MeasureToolCore via pulling files into my env. I meticulously got intellij to at least not complain. But it wont compile.
What a nightmare. Somehow that project has it use c++ 20, but then core complains about things that got deprecated in 17. It could be that I'm trying to build a console app, but who knows! It's a slog of convoluted examples, none of which represent a simple configuration of its parts. I can't even get to the need or concept of multi threading, because I can't deconstruct these examples into their core parts in any fashion.
Just even trying trying to read code and understand what namespace something comes from. What namespace is iinspectable in, windows foundation of course. How do I know that, chatgpt told me. You wouldn't know that looking here:
https://learn.microsoft.com/en-us/windows/win32/api/inspectable/nn-inspectable-iinspectable
It hallucinates stuff half the time so you get lucky here and there but heaven forbid the actual docs tell you the namespace. I'm sure I could go dig in header files too, but where are those. Again, all over the place!
I am not an ace dev, I get that. But this is the absolute worst developer experience of any language and system I've had in my life.
from win32capturesample.
I'm not sure what you mean by they don't work in a console app. I have several console apps that use them. If you're trying to use an API without linking the appropriate lib or including the appropriate header, I'm not sure what to tell you.
You're free to ask questions, but adding superfluous rants about other projects you come across isn't helpful.
from win32capturesample.
Here's a console app that takes a screenshot of the primary monitor using Windows.Graphics.Capture and feeds that image into OpenCV. I'm not familiar with OpenCV, so I used the contours2 demo. You can find the repo here: https://github.com/robmikh/WGCOpenCVInterop
Because I use Visual Studio, I used vcpkg to generate a Nuget package containing the necessary binaries, libs, and headers needed for using OpenCV. There are more details in the README, but you can also replace the Nuget package with whatever way you're used to consuming OpenCV. Additionally I used the header-only library WIL for an RAII wrapper around an event, but feel free to remove that and use your own implementation.
from win32capturesample.
Related Issues (20)
- WinSta0\\winlogon failed HOT 1
- Graphics Capture doesn't work when running as different user? HOT 6
- Help: Clarification HOT 2
- Simple recorder is giving error in WinUI3 HOT 2
- The quality of the captured picture is worse than that of the window HOT 4
- how to capture child window? HOT 2
- The effect of Borderless will be reset when desktop resolution changed HOT 1
- The performance overhead of capturing the desktop is too high. HOT 1
- How reliable is Windows Graphics Desktop Capture in replicating the monitor frames ? HOT 9
- Possible Problem With Some Apps HOT 1
- How to convert Bgra to Rgba HOT 1
- Windows 11 22H2 OS build 10.0.22621.2428: CreateCaptureSession(item) does not return and hangs HOT 28
- winrt::windows::Graphics::Capture::GraphicsCaptureSession.Close() hangs on Windows 10 HOT 8
- C++ docs for winrt HOT 1
- no callable 'await_resume' function found for type 'winrt::Windows::System::DispatcherQueue' HOT 2
- some questions about threading model HOT 1
- How to copy the captured frame data to CUDA directly without copy to CPU first? HOT 1
- How to convert captured frames to opencv matrix? HOT 2
- additional requirement HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from win32capturesample.