简体   繁体   中英

Custom camera UI for wp8

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.

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM