Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab8 black sreen #31

Open
alexlck opened this issue Mar 8, 2017 · 3 comments
Open

Lab8 black sreen #31

alexlck opened this issue Mar 8, 2017 · 3 comments

Comments

@alexlck
Copy link

alexlck commented Mar 8, 2017

when I run the code of lab 8,it was built successfully,but the mainwindow is black , I don't know what to do and anyone met the same problem with me?

@EthanRay
Copy link

I met the same problem with you. Waiting for someone help us....

@duranreloaded
Copy link

duranreloaded commented Mar 27, 2017

I ran into the same problem, but after some digging I managed to find what was the problem for me.

At some point you're asked to add SetupCurrentDisplay (DEFAULT_DISPLAYFRAMETYPE) to your newly declared MainPage_Loaded.

void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    SetupCurrentDisplay(DEFAULT_DISPLAYFRAMETYPE);
}

When you do this you this you also need to make sure that you remove the SetupCurrentDisplay (DEFAULT_DISPLAYFRAMETYPE) from the MainPage() (as mentioned in Lab8). I, sadly enough, forgot to do this and ended up declaring it twice.

That means that your MainPage() should go from this:

public MainPage()
        {
            this.kinectSensor = KinectSensor.GetDefault();

            SetupCurrentDisplay(DEFAULT_DISPLAYFRAMETYPE);

            this.coordinateMapper = this.kinectSensor.CoordinateMapper;

            this.multiSourceFrameReader = this.kinectSensor.OpenMultiSourceFrameReader(
                FrameSourceTypes.Infrared
                | FrameSourceTypes.Color
                | FrameSourceTypes.Depth
                | FrameSourceTypes.BodyIndex
                | FrameSourceTypes.Body);

// ...

To this:

 public MainPage()
        {
            this.kinectSensor = KinectSensor.GetDefault();

            this.coordinateMapper = this.kinectSensor.CoordinateMapper;

            this.multiSourceFrameReader = this.kinectSensor.OpenMultiSourceFrameReader(
                FrameSourceTypes.Infrared
                | FrameSourceTypes.Color
                | FrameSourceTypes.Depth
                | FrameSourceTypes.BodyIndex
                | FrameSourceTypes.Body);

// ...

If this was the case, then after changing this, everything should work as intended.

I hope this helps!

@alexlck
Copy link
Author

alexlck commented Mar 31, 2017

I think I have already removed it ...And I used the code offered by the author, the same problem happened..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants