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


C++ WebView::surface方法代码示例

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


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

示例1: main

int main(int argc, char* argv[])
{
    int i;
    namedWindow("Frame");
    ////////////////////////////////////////////////////
    Mat frame_4, frame;

    //double dWidth = 640; //get the width of frames of the video
    //double dHeight = 480; //get the height of frames of the video
    

    

    vector<Mat> layers;
    WebCore* web_core = WebCore::Initialize(WebConfig());
    WebView* view = web_core->CreateWebView(WIDTH, HEIGHT);
    WebURL url(WSLit(URL_polar));
    view->LoadURL(url);
    BitmapSurface* surface;

    Size frameSize(static_cast<int>(WIDTH), static_cast<int>(HEIGHT));
    VideoWriter writer ("polarbearchillin.avi", CV_FOURCC('D','I','V','3'), 15, frameSize, true); //initialize the VideoWriter object 


    for(int i=0; i<1000000; i++) //delay is added to pass advertisement on some of the URLs
    {
        web_core->Update();
    }
    ///////////////////////////////////////////////////

    if ( !writer.isOpened() ) //if not initialize the VideoWriter successfully, exit the program
    {
        cout << "ERROR: Failed to write the video" << endl;
        return -1;
    }

    while(i != 27)
    {
        ////////////////////////////////////////////////

        web_core->Update();
        surface = (BitmapSurface*)view->surface();
        frame_4 = Mat(Size(WIDTH, HEIGHT), CV_8UC4, (unsigned char*)surface->buffer(), Mat::AUTO_STEP);
        split(frame_4, layers);
        layers.pop_back();
        merge(layers, frame);

        ////////////////////////////////////////////////
        writer.write(frame); //writer the frame into the file
        imshow("Frame", frame);
        i=waitKey(30);
    }
    ///////////////////////
    view->Destroy();
    WebCore::Shutdown();
    ///////////////////////
    destroyAllWindows();
    return 0;
}
开发者ID:akamus082,项目名称:CameraTrap,代码行数:59,代码来源:main.cpp

示例2: surface

	const BitmapSurface* surface()const
	{
		return static_cast<BitmapSurface*>(view_->surface());
	};
开发者ID:LenihanConor,项目名称:Cluiche,代码行数:4,代码来源:Main.cpp


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