forrestrunner
forrestrunner

Reputation: 41

C# Surface Pro 4 Camera

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

Answers (2)

forrestrunner
forrestrunner

Reputation: 41

I solved the problem by using Emgu CV and WPF: http://www.emgu.com/wiki/index.php/Main_Page

Upvotes: 0

Chris Pickford
Chris Pickford

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

Related Questions