modelflat / zbl

real-time window capture library based on D3D11 and Windows.Graphics.Capture
MIT License
14 stars 3 forks source link

add property is_border_required #4

Closed Elypha closed 5 months ago

Elypha commented 5 months ago

hi,

thanks for your project

I hope this closes https://github.com/modelflat/zbl/issues/3

Elypha commented 5 months ago

also if I may suggest to rename the other property capture_cursor to is_cursor_capture_enabled, since if this project will remain largely a wrapper/extension around the Windows.Graphics.Capture API, it might be better to just keep their names from the original API

it's longer, yes, but I assume it's less likely your users write code on notepad so they won't be angry with the change x

modelflat commented 5 months ago

@Elypha Hi, thanks for contributing! Couple of notes:

Elypha commented 5 months ago

@modelflat thanks for the feedback!

I'm trying to fix the examples in 98654ce (#4) and hope they are working

For the capture init error, it seems like args are not passed to the constructor properly but I'm not very familiar with rust so I'm likely mistaken. I'm using the Python lib and it works great. My machine runs Windows 11 22H2 and Python 3.12, and here's a dev build if you are interested to test it x dist.zip

Elypha commented 5 months ago

wait I asked mr gpt and the error code indicates something related to the os api then I checked the MS api manual, and yes, the border option is not supported in some versions in windows 10:

Device family | Windows 10, version 2104 (introduced in 10.0.20348.0)

https://learn.microsoft.com/en-gb/uwp/api/windows.graphics.capture.graphicscapturesession.isborderrequired?view=winrt-20348

Elypha commented 5 months ago

great, can you test if all the changes work now

Elypha commented 5 months ago

sorry microsoft /j the default values in the rust constructor and python lib are updated

modelflat commented 5 months ago

Merged! Thank you so much for your contribution ❤️