Extension Methods not found

Feb 4, 2012 at 4:18 PM

'Microsoft.Kinect.ColorImageFrame' does not contain a definition for 'ToBitmapSource' and no extension method 'ToBitmapSource' accepting a first argument of type 'Microsoft.Kinect.ColorImageFrame' could be found (are you missing a using directive or an assembly reference?)

Feb 4, 2012 at 4:30 PM

Sorry, nevermined. Forgot the using statement.

Feb 6, 2012 at 1:08 AM

...but I have the "using" statement, and still can't get any calls to the Coding4Fun.Kinect.Wpf dll to work. :(

I'm using the Beta 2 SDK and have followed along the Channel 9 tutorials without issue until I hit this line of code (in red) near the end of the 3rd QuickStart video (Camera Fundamentals):

        void nui_VideoFrameReady(object sender, ImageFrameReadyEventArgs e)
            // PlanarImage image = e.ImageFrame.Image;
            // image1.Source = BitmapSource.Create(image.Width, image.Height, 96, 96, PixelFormats.Bgr32,
                            null, image.Bits, image.Width * image.BytesPerPixel);

            image1.Source = e.ImageFrame.ToBitmapSource();

In short, when I try to run the application like this, I get a build error and it won't run. Also, I noticed after paying close attention that when I type ".ToBitmapSource" in Visual C# Express, the ToBitmapSource method does not appear in the auto-complete box. In the tutorial after paying close attention I noticed that it did appear in the instructor's auto complete box. This makes me think something with the reference to the WPF dll is broken, but everything seems to be fine. I am using the 'using' statement properly, and I have a reference to it, and I modified my IDE config XML file so that it would load the WPF dll properly as it's a file from the web.

I tried hacking around to get the Depth Camera window to display & populate without using the Coding4Fun method but I wasn't able to figure it out. I am officially stuck.

I'd appreciate any tips on how to fix this if anyone has done so. I'm eager to start building some basic applications but still can't get this key tool to work as I understand it should.

Thanks in advance for your help!

Feb 6, 2012 at 1:48 AM

Jay, if you're using the beta 2 version, you have to use the extentions that are targeting beta 2.  What we just released is targeting the v1 kinect for windows SDK.  You'll want this version instead http://c4fkinect.codeplex.com/releases/view/76271

Things changed between the beta and the final release.  Lots of improvements and some API changes.

Feb 6, 2012 at 2:43 AM

YES!! I appreciate the quick reply; updating my version of the WPF dll did the trick.


Feb 6, 2012 at 2:54 AM

No problem, I'd highly suggest trying the v1 of the Kinect for Windows SDK.  The Channel 9 does have updated quickstarts for it too.