我正在尝试获取WebKitWebView的快照。
调用GAsyncReadyCallback,但是调用后返回cairo_surface_t *并将GError *传递给webkit_web_view_get_snapshot_finish为空。
//.cpp
void ExampleProgram::TakeSnapshot()
{
webkit_web_view_get_snapshot (m_webView,
WEBKIT_SNAPSHOT_REGION_FULL_DOCUMENT,
WEBKIT_SNAPSHOT_OPTIONS_NONE,
NULL,
(GAsyncReadyCallback)onTakeWebviewSnapshotFinished,
NULL);
}
void ExampleProgram::onTakeWebviewSnapshotFinished(WebKitWebView* webView, GParamSpec* pspec)
{
GAsyncResult * result;
GError *error = NULL;
cairo_surface_t * surface = webkit_web_view_get_snapshot_finish(webView, result, &error);
}
//.h
void TakeSnapshot();
static void onCaptureFullWebviewFinished(WebKitWebView* webView, GParamSpec* pspec);