简体   繁体   English

wp8的自定义相机UI

[英]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. 但是,我没有使用默认的相机应用程序,而是尝试像其他第三方应用程序一样为相机创建自定义UI。 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? 好吧,我的相机用户界面将是基本的,所以我想知道是否可以在CameraCaptureTask实现此功能,还是需要创建一些单独的UserControl页面?

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. 您可以为此使用PhotoCamera类。

This MSDN page clearly explains how to stream and capture images using camera 这个 MSDN页面清楚地说明了如何使用相机流式传输和捕获图像

The code given below shows how to initialize PhotoCamera 下面给出的代码显示了如何初始化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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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