Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:09:32+00:00 2026-06-11T22:09:32+00:00

I am trying to use a KinectColorViewer in a project using Kinect for windows

  • 0

I am trying to use a KinectColorViewer in a project using Kinect for windows (sdk 1.5). In the kinect explorer example, the KinectColorViewer componant had a KinectSensorManager component that is binded. In the xaml file we have:

<kt:KinectColorViewer x:Name="ColorViewer" KinectSensorManager="{Binding KinectSensorManager}" CollectFrameRate="True" RetainImageOnSensorChange="True" />

I have a lot of trouble reproduccing the same concept in other projects. I have used the Microsoft.Kinect.Toolkit’s KinectSensorChooser, KinectSensorChooserUI and the Mirosoft.Sampels.Kinect.wpfviewers KinectColorViewer. Tried to bind the KinectSensorManager of The colorViewer to the UI element and follows.

<my:KinectColorViewer Width="200" Height="200" HorizontalAlignment="Left" Margin="198,12,0,0" Name="kinectColorViewer1" VerticalAlignment="Top" KinectSensorManager="{Binding ElementName=kinectSensorChooserUI1, Path=KinectSensorChooser.Kinect}" />

both attempts were unsuccesfull. Has anyone used the ColorViwer, DepthViwer and SkeletonViewer using the new SDK? Figuring that our would be great…

To bind the KinectSensorManager, I added the following code to the back end:

public partial class MainWindow : Window
{
  public KinectSensorManager KinectSensorManager { get; set;}
  private void WindowLoaded(object sender, RoutedEventArgs e)
{
  KinectSensorManager = new KinectSensorManager();

  KinectSensorManager.KinectSensorChanged += new EventHandler<KinectSensorManagerEventArgs<KinectSensor>>(KinectSensorManager_KinectSensorChanged);

        // Look through all sensors and start the first connected one.
        // This requires that a Kinect is connected at the time of app startup.
        foreach (var potentialSensor in KinectSensor.KinectSensors)
        {
            if (potentialSensor.Status == KinectStatus.Connected)
            {
                this.sensor = potentialSensor;
                break;
            }
        }

        if (null != this.sensor)
        {
            // Turn on the skeleton stream to receive skeleton frames

            this.sensor.SkeletonStream.Enable();
            this.sensor.DepthStream.Enable();
            this.sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
            this.sensor.AllFramesReady += new System.EventHandler<AllFramesReadyEventArgs>(sensor_AllFramesReady);
            this.sensor.SkeletonFrameReady += this.SensorSkeletonFrameReady;

            // Start the sensor!
            try
            {
                this.sensor.Start();
            }
            catch (IOException)
            {
                this.sensor = null;
            }

            var kinectSensorBinding = new Binding("KinectSensor") { Source = this.sensor };
            BindingOperations.SetBinding(this.KinectSensorManager, KinectSensorManager.KinectSensorProperty, kinectSensorBinding);

        }

        if (null == this.sensor)
        {
            this.statusBarText.Text = Properties.Resources.NoKinectReady;
        }

    }

and the Xaml file:

<kt:KinectColorViewer Width="191" Height="83" Grid.Column="3" KinectSensorManager="{Binding KinectSensorManager}" HorizontalAlignment="Left" Margin="17,236,0,0" Name="kinectColorViewer1" VerticalAlignment="Top" />

but I still dont get any color stream.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:09:33+00:00Added an answer on June 11, 2026 at 10:09 pm

    You binding statement is incorrect. “KinectSensorChooser.Kinect” is a reference to hardware (i.e., the Kinect) selected by the KinectSensorChooser — it is not the KinectSensorManager.

    You should be binding to the KinectSensorManager in the same way the examples show you. Is there something special you are trying to do that would lead you to bind it differently?

    Your main class should start out something like this:

    // automatically finds a Kinect for you
    private readonly KinectSensorChooser sensorChooser = new KinectSensorChooser();
    
    // the bindable sensor property
    public KinectSensorManager KinectSensorManager { get; private set; }
    
    public MainViewModel()
    {
        if (IsInDesignMode) {
            // load design mode only content
        }
        else
        {
            // initialize the Kinect sensor manager
            KinectSensorManager = new KinectSensorManager();
            KinectSensorManager.KinectSensorChanged += this.KinectSensorChanged;
    
            // locate an available sensor
            sensorChooser.Start();
    
            // bind chooser's sensor value to the local sensor manager
            var kinectSensorBinding =
                new Binding("Kinect") { Source = this.sensorChooser };
            BindingOperations.SetBinding(
                this.KinectSensorManager,
                KinectSensorManager.KinectSensorProperty,
                kinectSensorBinding);
        }
    }
    
    #region Kinect Discovery & Setup
    
    private void KinectSensorChanged(object sender,
        KinectSensorManagerEventArgs<KinectSensor> args)
    {
        if (null != args.OldValue)  
            UninitializeKinectServices(args.OldValue);
    
        if (null != args.NewValue)
            InitializeKinectServices(KinectSensorManager, args.NewValue);
    }
    
    // Kinect enabled apps should customize which Kinect services it initializes here.
    private void InitializeKinectServices(
        KinectSensorManager kinectSensorManager, 
        KinectSensor sensor)
    {
        // Application should enable all streams first.
    
        // configure the color stream
        kinectSensorManager.ColorFormat = 
            ColorImageFormat.RgbResolution640x480Fps30;
        kinectSensorManager.ColorStreamEnabled = true;
    
        // configure the depth stream
        kinectSensorManager.DepthStreamEnabled = true;
    
        kinectSensorManager.TransformSmoothParameters = 
            new TransformSmoothParameters
            {
                Smoothing = 0.5f,
                Correction = 0.5f,
                Prediction = 0.5f,
                JitterRadius = 0.05f,
                MaxDeviationRadius = 0.04f
            };
    
        // configure the skeleton stream
        sensor.SkeletonFrameReady += OnSkeletonFrameReady;
        kinectSensorManager.SkeletonStreamEnabled = true;
    }
    
    // Kinect enabled apps should uninitialize all Kinect services that were initialized in InitializeKinectServices() here.
    private void UninitializeKinectServices(KinectSensor sensor)
    {
        sensor.SkeletonFrameReady -= this.OnSkeletonFrameReady;
    }
    
    #endregion Kinect Discovery & Setup
    

    You can then bind to the manager from your View as shown by the examples.

    You make need to also set the DataContext, by putting the following into the constructor:
    DataContext = this;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
Anyone know how to create a cvCreateStructuringElementEx using a image? I'm trying use opencv.cv.cvCreateStructuringElementEx()
I was trying use svn to find a checkin using svn log, but it
I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
I'm trying use eco for client-side templating. I have multiple .eco templates that I'd
I am trying use a from a multi-dimensional array that I create in another
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a
I'm trying use an object which wasn't available until SDK level 5. It seems
I am trying use the jQuery table sorter plugin for a table that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.