本文整理汇总了C++中WebView::LoadURL方法的典型用法代码示例。如果您正苦于以下问题:C++ WebView::LoadURL方法的具体用法?C++ WebView::LoadURL怎么用?C++ WebView::LoadURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebView
的用法示例。
在下文中一共展示了WebView::LoadURL方法的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;
}
示例2: OnLoaded
// Inherited from Application::Listener
virtual void OnLoaded()
{
// view_ = View::Create(800, 600, windowHandle_);
view_ = app_->web_core()->CreateWebView(800, 600);
//WebView* web_view = view_->web_view();
view_->SetTransparent(true);
BindMethods(view_);
WebURL url(WSLit("file:///C:/_git/Dia/Cluiche/AwesomiumTest/app.html"));
view_->LoadURL(url);
while (view_->IsLoading())
app_->web_core()->Update();
Sleep(300);
app_->web_core()->Update();
isFinished = true;
}