我只想在弹出窗口中使用 kinect 区域。所以,当它关闭时,我不想看到任何 kinect 光标或类似的东西。问题是当弹出窗口打开时我看不到光标。
这是我的 xaml 代码,我在该区域内弹出窗口。
<k:KinectRegion Name="kurs" Margin="0,0,0,0" >
<Popup Placement="Left" PlacementTarget="{Binding ElementName=OptionOfDrawing}" PopupAnimation="Fade" x:Name="Popup"
IsOpen="False">
<StackPanel Height="325" Width="492" Background="White">
<TextBlock Margin="0 0 0 0">FontSize</TextBlock>
<k:KinectScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto"
VerticalAlignment="Bottom">
<StackPanel Orientation="Horizontal" Name="MyScroll" />
</k:KinectScrollViewer>
</Grid>
</StackPanel>
</Popup>
</k:KinectRegion>
我添加了这个命名空间
xmlns:k="http://schemas.microsoft.com/kinect/2013".
这是我背后的代码。
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
if (sen != null && this.Popup.IsOpen == true)
kurs.KinectSensor = KinectSensor.KinectSensors[0];
sen = KinectSensor.KinectSensors.FirstOrDefault();
if (sensor == null)
{
MessageBox.Show("I need kinect");
this.Close();
}
sen.ColorStream.Enable();
sen.ColorFrameReady += new EventHandler<ColorImageFrameReadyEventArgs>(sensor_ColorFrameReady);
sen.DepthStream.Enable();
sen.SkeletonStream.Enable();
sen.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>( sensor_SkeletonFrameReady);
sen.DepthFrameReady += new EventHandler<DepthImageFrameReadyEventArgs>( sensor_DepthFrameReady);
interactionstream = new InteractionStream(sen, new NewInteractionClient());
interactionstream.InteractionFrameReady += new EventHandler<InteractionFrameReadyEventArgs>( interactionstream_InteractionFrameReady);
sen.Start();
sen.ElevationAngle = 0;
}
我几乎可以肯定,一个 kinect 设备不能连接到两个不同的 KinectSensor 对象。那么,当弹出窗口打开时,kinect 设备连接到该区域,这条线不应该做吗?
sen = KinectSensor.KinectSensors[0];
任何建议对我来说都是无价的。