Ejemplo n.º 1
0
 void StopColorImage()
 {
     if (_colorImageStream != null)
     {
         _colorImageStream.Dispose();
         _colorImageStream = null;
     }
 }
Ejemplo n.º 2
0
 void StopColorImage()
 {
     if (_colorImageStream != null)
     {
         _colorImageStream.Dispose();
         _colorImageStream = null;
     }
 }
Ejemplo n.º 3
0
        void CreateColorImageStream(KinectImageResolution resolution)
        {
            StopColorImage();
            if (resolution == KinectImageResolution.None)
            {
                return;
            }

            _colorImageStream = new V2ImageStream(Sensor);
        }
Ejemplo n.º 4
0
        void CreateColorImageStream(KinectImageResolution resolution)
        {
            StopColorImage();
            if (resolution == KinectImageResolution.None)
            {
                return;
            }

            _colorImageStream = new V2ImageStream(Sensor);
        }
Ejemplo n.º 5
0
        public MainWindow()
        {
            var sensor = V2Sensor.GetDefault();
            _sensor = sensor;

#if true
            {
                // setup depth stream
                var depthStream = new V2DepthStream(sensor.Sensor);

                // create the bitmap to display
                _depthSource = new WriteableBitmap(
                    depthStream.Resolution.Width(),
                    depthStream.Resolution.Height(),
                    96.0, 96.0, PixelFormats.Gray16, null);

                var depthWaitHandle = new ManualResetEvent(false);
                depthWaitHandle.SafeWaitHandle = new Microsoft.Win32.SafeHandles.SafeWaitHandle(
                    depthStream.CreateWaitHandle(), false);

                StartUpdating(depthWaitHandle, depthStream);
            }
#endif

#if false
            {
                // setup image stream
                var imageStream = new V2ImageStream(sensor.Sensor);

                // create the bitmap to display
                DepthSource = new WriteableBitmap(
                    imageStream.Width,
                    imageStream.Height,
                    96.0, 96.0, PixelFormats.Bgr32, null);

                var waitHandle = new ManualResetEvent(false);
                waitHandle.SafeWaitHandle = new Microsoft.Win32.SafeHandles.SafeWaitHandle(
                    imageStream.CreateWaitHandle(), false);

                StartUpdating(waitHandle, imageStream);
            }
#endif

            InitializeComponent();
        }