secile / UsbCamera

C# source code for using usb camera and web camera in WinForms/WPF. With only single CSharp source code. No external library required.
MIT License
179 stars 55 forks source link

Can This Work With WPF #5

Closed AlBannaTechno closed 3 years ago

AlBannaTechno commented 3 years ago

First Thankyou for this awesome work,

is there a way to use it with WPF?

secile commented 3 years ago

Hello, thank you for your question. I am not familiar with WPF, but as I tried, this source code could be used if you add reference to 'System.Drawing'.

GetBitmap() returns System.Drawing.Bitmap, so you have to convert to BitmapSource if you want to use in BitmapSource of Image control.

AlBannaTechno commented 3 years ago

@secile thank you, I used another library but still use the same trick since that library also supports only windows form.

So your answer is 100% Correct, thank you.

yangjieshao commented 3 years ago

@AlBannaTechno
you can use like this https://github.com/secile/UsbCamera/pull/6

Demo