本文整理汇总了C#中Frame.Pointable方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.Pointable方法的具体用法?C# Frame.Pointable怎么用?C# Frame.Pointable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame.Pointable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DispatchLostEvents
private static void DispatchLostEvents(Frame newFrame, Frame oldFrame)
{
foreach( Hand h in oldFrame.Hands )
{
if( !h.IsValid )
continue;
if( !newFrame.Hand(h.Id).IsValid && HandLost != null )
HandLost(h.Id);
}
foreach( Pointable p in oldFrame.Pointables )
{
if( !p.IsValid )
continue;
if( !newFrame.Pointable(p.Id).IsValid && PointableLost != null )
PointableLost(p.Id);
}
}
示例2: DispatchFoundEvents
private static void DispatchFoundEvents(Frame newFrame, Frame oldFrame)
{
foreach( Hand h in newFrame.Hands )
{
if( !h.IsValid )
continue;
if( !oldFrame.Hand(h.Id).IsValid && HandFound != null)
HandFound(h);
}
foreach( Pointable p in newFrame.Pointables )
{
if( !p.IsValid )
continue;
if( !oldFrame.Pointable(p.Id).IsValid && PointableFound != null )
PointableFound(p);
}
}
示例3: DispatchUpdatedEvents
private static void DispatchUpdatedEvents(Frame newFrame, Frame oldFrame)
{
foreach( Hand h in newFrame.Hands )
{
if( !h.IsValid )
continue;
if( oldFrame.Hand(h.Id).IsValid)
HandUpdated(h);
}
foreach( Pointable p in newFrame.Pointables )
{
if( !p.IsValid )
continue;
if( oldFrame.Pointable(p.Id).IsValid)
PointableUpdated(p);
}
}
示例4: DispatchUpdatedEvents
private static void DispatchUpdatedEvents(Frame newFrame, Frame oldFrame)
{
// For each Hand in the new Frame
foreach( Hand h in newFrame.Hands )
{
// Do nothing if the hand is invalid (fire no events)
if( !h.IsValid )
continue;
// If the hand was valid in the previous Frame and is _still_
// valid, and the HandUpdated event has a handler
if( oldFrame.Hand(h.Id).IsValid && HandUpdated != null)
// Fire the HandUpdated event for this Hand
HandUpdated(h);
}
// Do the same as above for pointables (Fingers and Tools)
// (Note that Hands are not Pointables)
foreach( Pointable p in newFrame.Pointables )
{
if( !p.IsValid )
continue;
if( oldFrame.Pointable(p.Id).IsValid && PointableUpdated != null)
PointableUpdated(p);
}
}
示例5: DispatchLostEvents
private static void DispatchLostEvents(Frame newFrame, Frame oldFrame)
{
// Iterate over hands in the previous frame
foreach( Hand h in oldFrame.Hands )
{
// If this hand in the previous frame was invalid, continue
// (A valid hand is one that contains valid tracking data)
if( !h.IsValid )
continue;
// If this hand in the previous frame was valid, but is now
// invalid, and if the HandLost event has a handler
if( !newFrame.Hand(h.Id).IsValid && HandLost != null )
// Fire the HandLost event for this hand
HandLost(h.Id);
}
// Do the same as above for pointables (Fingers and Tools)
// (Note that Hands are not Pointables)
foreach( Pointable p in oldFrame.Pointables )
{
if( !p.IsValid )
continue;
if( !newFrame.Pointable(p.Id).IsValid && PointableLost != null )
PointableLost(p.Id);
}
}
示例6: DispatchFoundEvents
private static void DispatchFoundEvents(Frame newFrame, Frame oldFrame)
{
// Iterate over hands in the new frame
foreach( Hand h in newFrame.Hands )
{
// If the current hand is not valid, continue (fire no events)
if( !h.IsValid )
continue;
// If the current hand was not valid in the previous frame
// and if the HandLost event has a handler
if( !oldFrame.Hand(h.Id).IsValid && HandFound != null)
// Fire the HandFound event for this hand
HandFound(h);
}
// Do the same as above for pointables (Fingers and Tools)
// (Note that Hands are not Pointables)
foreach( Pointable p in newFrame.Pointables )
{
if( !p.IsValid )
continue;
if( !oldFrame.Pointable(p.Id).IsValid && PointableFound != null )
PointableFound(p);
}
}
示例7: DispatchUpdatedEvents
private static void DispatchUpdatedEvents(Frame newFrame, Frame oldFrame)
{
foreach( Hand h in newFrame.Hands )
{
if( !h.IsValid )
continue;
if( oldFrame.Hand(h.Id).IsValid && HandUpdated != null)
HandUpdated(h, !HandCloseToBoundary(h));
}
foreach( Pointable p in newFrame.Pointables )
{
if( !p.IsValid )
continue;
if( oldFrame.Pointable(p.Id).IsValid && PointableUpdated != null)
PointableUpdated(p, !FingerCloseToBoundary(p) && !DraggingMode);
}
}