Amazing-Ren

导航

例子:Basic Lens sample

本例演示了如何自己扩展一个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);
    }

 

 

 

 

 

 

 

 

 

 

 

 

posted on 2013-08-14 16:24  Amazing-Ren  阅读(180)  评论(0编辑  收藏  举报