當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。