当前位置: 首页>>代码示例>>C#>>正文


C# AllFramesReadyEventArgs.OpenFrame方法代码示例

本文整理汇总了C#中AllFramesReadyEventArgs.OpenFrame方法的典型用法代码示例。如果您正苦于以下问题:C# AllFramesReadyEventArgs.OpenFrame方法的具体用法?C# AllFramesReadyEventArgs.OpenFrame怎么用?C# AllFramesReadyEventArgs.OpenFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AllFramesReadyEventArgs的用法示例。


在下文中一共展示了AllFramesReadyEventArgs.OpenFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MyAllFramesReadyEventHandler

 //This is the handler to be given to GeneratorSingleton.Instance.AllFramesReady.
 //In order to easily switch to waiting separately for each stream
 //(GeneratorSingleton.Instance.DataFrameReady and GeneratorSingleton.Instance.ColorImageFrameReady),
 //The issue the following, instead of MyAllFramesReadyEventHandler:
 // GeneratorSingleton.Instance.DataFrameReady += JointsUpdate.MyDataFrameReady;
 // GeneratorSingleton.Instance.ColorImageFrameReady += RgbTextureUpdate.MyColorImageFrameReadyEventHandler;
 private void MyAllFramesReadyEventHandler(object sender, AllFramesReadyEventArgs e)
 {
     using (var allFrames = e.OpenFrame() as AllFramesFrame)
     {
         if (allFrames != null)
         {
             foreach (var evtArgs in allFrames.FramesReadyEventArgs)
             {
                 var colorImageFrameReady = evtArgs as ColorImageFrameReadyEventArgs;
                 if (null != colorImageFrameReady)
                 {
                     this.MyColorImageFrameReadyEventHandler(sender, colorImageFrameReady);
                     continue;
                 }
                 var dataFrameReady = evtArgs as DataFrameReadyEventArgs;
                 if (null != dataFrameReady)
                 {
                     this.MyDataFrameReady(sender, dataFrameReady);
                     continue;
                 }
                 var gestureFrameReady = evtArgs as GesturesFrameReadyEventArgs;
                 if (null != gestureFrameReady)
                 {
                     this.MyRecognitionFrameReadyEventHandler(sender, gestureFrameReady);
                     continue;
                 }
             }
             LogWarnings(allFrames.FrameKey.FrameNumberKey);
         }
     }
 }
开发者ID:chengoldberg,项目名称:extreme-motion-robot,代码行数:37,代码来源:MainWindow.xaml.cs

示例2: MyAllFramesReadyEventHandler

 private void MyAllFramesReadyEventHandler(object sender, AllFramesReadyEventArgs e)
 {
     try
     {
         using (var allFrames = e.OpenFrame() as AllFramesFrame)
         {
             if (allFrames != null)
             {
                 foreach (var evtArgs in allFrames.FramesReadyEventArgs)
                 {
                     var colorImageFrameReady = evtArgs as ColorImageFrameReadyEventArgs;
                     if ((ExtremeMotionEventsManager.MyColorImageFrameReadyHandler != null) && (null != colorImageFrameReady))
                     {
                         ExtremeMotionEventsManager.MyColorImageFrameReadyHandler(sender, colorImageFrameReady);
                         continue;
                     }
                     var dataFrameReady = evtArgs as DataFrameReadyEventArgs;
                     if ((ExtremeMotionEventsManager.MyDataFrameReadyHandler != null) && (null != dataFrameReady))
                     {
                         ExtremeMotionEventsManager.MyDataFrameReadyHandler(sender, dataFrameReady);
                         continue;
                     }
                     var gesturesFrameReady = evtArgs as GesturesFrameReadyEventArgs;
                     if ((ExtremeMotionEventsManager.MyGesturesFrameReadyHandler != null) && (null != gesturesFrameReady))
                     {
                         ExtremeMotionEventsManager.MyGesturesFrameReadyHandler(sender, gesturesFrameReady);
                         continue;
                     }
                 }
             }
         }
     }
     catch (System.Exception ex)
     {
         Debug.LogError("Error in MyAllFramesReadyEventHandler: \n" + ex.ToString());
     }
 }
开发者ID:erikhansen418dev,项目名称:TrainingMotionApp,代码行数:37,代码来源:SdkManager.cs


注:本文中的AllFramesReadyEventArgs.OpenFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。