有什么方法来绘制Webbrowser内容到特定的DC吗? [英] Is there any way to draw Webbrowser content to a specific DC?

查看:247
本文介绍了有什么方法来绘制Webbrowser内容到特定的DC吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些天,我尝试在我的程序中创建一个hiden WebBrowser控件,并使用IViewObject接口绘制到我的自定义DC。



结果很好,我got所有我想要的内容,但绘制速度是不能接受的,特别是一些复杂的网页包含Flash对象,每个绘制到DC成本超过100毫秒。所以我绘制的闪光对象不光滑。



有快速的方法可以将控制权绘制到我的特定DC吗?



my code sinpet就像这样:

  // hCompDc是一个CompatibleDC,选择一个CompatibleBitmap。 
RECTL imageRect = {0,0,nWidth,nHeight};
pHtmlDocument2-> QueryInterface(IID_IViewObject,(void **)& pViewObject);
pViewObject-> Draw(DVASPECT_CONTENT,-1,NULL,NULL,NULL,hCompDc,NULL,& imageRect,NULL,0);谢谢您阅读这个问题。



>等待你的答案〜

解决方案

没有其他方法可以做到这一点。您使用的组件(IE,Flash等)都没有设计为使用这种方式。如果绘制时间是一个问题,你必须在一个单独的线程和同步。


These days, I tries to create a hiden WebBrowser control in my program, and Using the IViewObject interface draw to my custom DC.

The result is fine, I got All the content I want, but the Draw speed is unacceptable, especially some complex web pages which contains Flash objects, Each Draw to DC cost more than 100 ms. So the flash object I drew is not smooth.

Is there a fast way to draw the control to my a specific DC?

my code sinpet is like this:

//hCompDc is a CompatibleDC which select a CompatibleBitmap.
RECTL imageRect = {0, 0, nWidth, nHeight};
pHtmlDocument2->QueryInterface(IID_IViewObject, (void **)&pViewObject);
pViewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL, hCompDc, NULL, &imageRect, NULL, 0);

Thank you for reading this question.

Waiting for your answers~

解决方案

There is no other way to do this. None of the components you're using--IE, Flash, etc--were designed to be used this way. If draw time is an issue, you have to do it on a separate thread and synchronize.

这篇关于有什么方法来绘制Webbrowser内容到特定的DC吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆