Example #1
0
	//--
	void
	Dialog::eventFrameColor()
	{
		const NUI_IMAGE_FRAME* image_frame = NULL;

		HRESULT hr = ::NuiImageStreamGetNextFrame(m_color_stream_handle, 0, &image_frame);
		
		if(FAILED(hr))
		{
			return;	
		}

		NuiImageBuffer* texture = image_frame->pFrameTexture;
		KINECT_LOCKED_RECT locked_rect;
		texture->LockRect(0, &locked_rect, NULL, 0);

		if(locked_rect.Pitch != 0)
    	{
    		m_display->drawColor((const unsigned char*) locked_rect.pBits);
    	}

    	texture->UnlockRect(0);

		::NuiImageStreamReleaseFrame(m_color_stream_handle, image_frame);
	}
Example #2
0
	//--
	void
	Dialog::eventFrameDepth()
	{
		const NUI_IMAGE_FRAME* image_frame = NULL;

		HRESULT hr = ::NuiImageStreamGetNextFrame(m_depth_stream_handle, 0, &image_frame);
		
		if(FAILED(hr))
		{
			return;	
		}

		NuiImageBuffer* texture = image_frame->pFrameTexture;
		KINECT_LOCKED_RECT locked_rect;
		texture->LockRect(0, &locked_rect, NULL, 0);

		if(locked_rect.Pitch != 0)
    	{
    		// [rad] Do nothing.
    	}

    	texture->UnlockRect(0);

		::NuiImageStreamReleaseFrame(m_depth_stream_handle, image_frame);
	}