The sample exposes some key concepts for working with the different data streams. The
DepthFrameReady event handler, for instance, takes each image provided sequentially by the depth
stream and parses it in order to distinguish player pixels from background pixels. Each image is broken
down into a byte array. Each byte is then inspected to determine if it is associated with a player image or
not. If it does belong to a player, the pixel is replaced with a flat color. If not, it is gray scaled. The bytes
are then recast to a bitmap object and set as the source for an image control in the UI. Then the process
begins again for the next image in the depth stream. One would expect that individually inspecting every
byte in this stream would take a remarkably long time but, as the fps indicator shows, in fact it does not.
This is actually the prevailing technique for manipulating both the color and depth streams. We will go
into greater detail concerning the depth and color streams in Chapter 2 and Chapter 3 of this book.