Permalink
Browse files

greenscreen now does masking

i am having problems connecting the player mask to the color video frame
from the kinect. this.colorPixels should be recieving the pixels from
the video frame (which the debugger is telling me it is), but I am
losing the data once i call a SetData() function to a Texture2D. Halp!
  • Loading branch information...
1 parent ab16e5e commit e15438423481ea8a7fb5a06b455ca6826511d1d3 @jadedoto jadedoto committed Feb 20, 2013
@@ -600,12 +600,13 @@ protected void kinect_AllFramesReady(object sender, AllFramesReadyEventArgs imag
}
}
- if (true)//this.foundPlayer)
+ if (this.foundPlayer)
{
// Do screenshot stuff.
this.colorFrame.CopyPixelDataTo(this.colorPixels);
Texture2D finalImage = new Texture2D(graphics.GraphicsDevice, this.kinect.ColorStream.FrameWidth, this.kinect.ColorStream.FrameHeight);
- finalImage.SetData(this.colorPixels);
+ //finalImage.SetData(this.colorPixels);
+ finalImage.SetData(this.greenScreenPixelData);
Stream stream = File.OpenWrite(this.Content.RootDirectory + "\\screenshots\\" + "snapshot-" + this.snapNumber + ".png");
finalImage.SaveAsPng(stream, 640, 480);
//finalImage.SaveAsPng(stream, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e154384

Please sign in to comment.