Reputation: 41
I am developing a WPF program in visual studio 2013. This program will be installed on MS Surface Pro 4's , one part of the application required to take an snap photo from the front camera.
I would like to place a button in my WPF program that will open the surface Pro 4 camera and take a picture. Does any one know how to accomplish this?
or if there are an DLL you can use for the camera.
Upvotes: 2
Views: 1773
Reputation: 41
I solved the problem by using Emgu CV and WPF: http://www.emgu.com/wiki/index.php/Main_Page
Upvotes: 0
Reputation: 8991
To use the native Windows camera "app" to capture an image you can make use of Windows.Media.Capture.CameraCaptureUI
:
CameraCaptureUI captureUI = new CameraCaptureUI();
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
captureUI.PhotoSettings.CroppedSizeInPixels = new Size(200, 200);
StorageFile photo = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
This will save the image to a location within your app's local storage where can you process as required.
See the following Microsoft article for more details: Capture photos and video with Windows built-in camera UI
Upvotes: 1