You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace Lib
{
public abstract class KinectStream : INotifyPropertyChanged
{
public KinectManager KinectManager { get; private set; }
private WriteableBitmap bitmap;
public WriteableBitmap Bitmap
{
get { return bitmap; }
protected set
{
if (bitmap != value)
{
bitmap = value;
OnPropertyChanged(nameof(bitmap));
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public KinectStream(KinectManager kinectManager)
{
KinectManager = kinectManager;
if (kinectManager.Sensor == null)
{
KinectManager.StartSensor();
}
}
public virtual void Start()
{
KinectManager.StartSensor();
}
public virtual void Stop()
{
KinectManager.StopSensor();
}
}
}