当前位置: 首页>>代码示例>>C++>>正文


C++ Kinect::stopDepthStream方法代码示例

本文整理汇总了C++中Kinect::stopDepthStream方法的典型用法代码示例。如果您正苦于以下问题:C++ Kinect::stopDepthStream方法的具体用法?C++ Kinect::stopDepthStream怎么用?C++ Kinect::stopDepthStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kinect的用法示例。


在下文中一共展示了Kinect::stopDepthStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MainProc

LRESULT CALLBACK MainProc(HWND handle, UINT message, WPARAM wParam,
                          LPARAM lParam) {
    switch (message) {
    case WM_CREATE: {
        HWND recalibButton = CreateWindowEx(0,
                "BUTTON",
                "Recalibrate",
                WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
                9,
                ImageVars::height - 9 - 28,
                100,
                28,
                handle,
                reinterpret_cast<HMENU>(IDC_RECALIBRATE_BUTTON),
                gInstance,
                nullptr);

        SendMessage(recalibButton,
                WM_SETFONT,
                reinterpret_cast<WPARAM>(GetStockObject(DEFAULT_GUI_FONT)),
                MAKELPARAM(FALSE, 0));


        HWND toggleStreamButton = CreateWindowEx(0,
                "BUTTON",
                "Start",
                WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
                ImageVars::width - 9 - 100,
                ImageVars::height - 9 - 28,
                100,
                28,
                handle,
                reinterpret_cast<HMENU>(IDC_STREAMTOGGLE_BUTTON),
                gInstance,
                nullptr);

        SendMessage(toggleStreamButton,
                WM_SETFONT,
                reinterpret_cast<WPARAM>(GetStockObject(DEFAULT_GUI_FONT)),
                MAKELPARAM(FALSE, 0));

        break;
    }

    case WM_COMMAND: {
        int wmId = LOWORD(wParam);

        switch (wmId) {
            case IDC_RECALIBRATE_BUTTON: {
                // If there is no Kinect connected, don't bother trying to retrieve images
                if (gProjectorKnt.isVideoStreamRunning()) {
                    TestScreen testWin(gInstance, false);
                    testWin.create(gCurrentMonitor.dim);

                    testWin.setColor(Processing::Red);
                    testWin.display();
                    // Give Kinect time to get image w/ test pattern in it
                    std::this_thread::sleep_for(std::chrono::milliseconds(750));
                    gProjectorKnt.setCalibImage(Processing::Red);

                    testWin.setColor(Processing::Blue);
                    testWin.display();
                    // Give Kinect time to get image w/ test pattern in it
                    std::this_thread::sleep_for(std::chrono::milliseconds(750));
                    gProjectorKnt.setCalibImage(Processing::Blue);

                    gProjectorKnt.calibrate();
                }

                break;
            }

            case IDC_STREAMTOGGLE_BUTTON: {
                // If button was pressed from video display window
                if (handle == gProjectorKnt.getRegisteredVideoWindow()) {
                    if (gProjectorKnt.isVideoStreamRunning()) {
                        gProjectorKnt.stopVideoStream();
                    }
                    else {
                        gProjectorKnt.startVideoStream();
                    }
                }

                // If button was pressed from depth image display window
                else if (handle == gProjectorKnt.getRegisteredDepthWindow()) {
                    if (gProjectorKnt.isDepthStreamRunning()) {
                        gProjectorKnt.stopDepthStream();
                    }
                    else {
                        gProjectorKnt.startDepthStream();
                    }
                }

                break;
            }

            case IDM_STARTTRACK: {
                gProjectorKnt.setMouseTracking(true);
                MessageBox(handle, "Mouse tracking has been enabled",
                           "Mouse Tracking", MB_ICONINFORMATION | MB_OK);
//.........这里部分代码省略.........
开发者ID:calcmogul,项目名称:KinectBoard,代码行数:101,代码来源:Main.cpp


注:本文中的Kinect::stopDepthStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。