您的位置:首页 > 其它

例子:Basic Lens sample

2013-08-14 16:24 155 查看
本例演示了如何自己扩展一个Camera Lens。

1. UI界面是一个MediaViewer

<controls:MediaViewer
x:Name="MediaViewer"
Items="{Binding CameraRoll}"
FooterVisibility="Visible"
FooterDisplayed="MediaViewer_FooterDisplayed"
ItemDisplayed="MediaViewer_ItemDisplayed"
ItemZoomed="MediaViewer_ItemZoomed"
ItemUnzoomed="MediaViewer_ItemUnzoomed"
InitiallyDisplayedElement="Last">
<controls:MediaViewer.FooterTemplate>


2. 实现类:

public enum ViewModelState { Unloaded, Loading, Loaded, AutoFocusInProgress, PointFocusAndCaptureInProgress, AutoFocusAndCaptureInProgress, CaptureInProgress }

class LensViewModel : DependencyObject, INotifyPropertyChanged, ICameraEngineEvents
{


接口ICameraEngineEvents:

interface ICameraEngineEvents
{
void OnCameraLoaded(ICameraCaptureDevice captureDevice);
void OnStillCaptureComplete(Stream thumbnailStream, Stream imageStream);
void OnReviewImageAvailable();
void OnFocusComplete(bool succeeded);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: