Reputation: 679
I tried to create an image based app that actually uses camera task when the app is opened. But instead of using the default camera app, I am trying to create a custom UI for the camera like other third-party apps does. Well, my camera UI will be basic, so i would like to know whether this can be achieved within the CameraCaptureTask
or do i need to create some separate UserControl page?
I am not able to find any resource or samples for this issue. Thanks in advance for your help.
Upvotes: 0
Views: 72
Reputation: 9309
You can use PhotoCamera
class for this.
This MSDN page clearly explains how to stream and capture images using camera
The code given below shows how to initialize PhotoCamera
PhotoCamera myCamera = new Microsoft.Devices.PhotoCamera(CameraType.Primary);
//viewfinderBrush is a videobrush object declared in xaml
viewfinderBrush.SetSource(myCamera);
myCamera.Initialized += myCamera_Initialized;
myCamera.CaptureCompleted += new EventHandler<CameraOperationCompletedEventArgs>(camera_CaptureCompleted);
myCamera.CaptureImageAvailable += new EventHandler<Microsoft.Devices.ContentReadyEventArgs>(camera_CaptureImageAvailable);
Upvotes: 1