开发者

How to draw a web page into a memory DC?

开发者 https://www.devze.com 2022-12-30 06:55 出处:网络
I would like to trick Chrome in to rendering i开发者_JS百科ts tabs in some memory device context of mine. Is this possible at all ? Thank you !There\'s a method in chrome.tabs called captureVisibleTab

I would like to trick Chrome in to rendering i开发者_JS百科ts tabs in some memory device context of mine. Is this possible at all ? Thank you !


There's a method in chrome.tabs called captureVisibleTab. What you get back is either a PNG or JPEG.

http://code.google.com/chrome/extensions/tabs.html

That API is available to Chrome extensions - but you can't call it from ordinary JavaScript in an unextended browser. I presume this is the technique used by "Aviary Screen Capture".

If you have a C++ program running in its own process, and you want to "poke into" Chrome - there are a lot of dodgy ways to do window hooks and capturing. But why not save yourself the trouble? Chrome is based on WebKit - just use WebKit directly. Qt makes it super easy, for instance:

http://doc.qt.nokia.com/4.6/examples-webkit.html

0

精彩评论

暂无评论...
验证码 换一张
取 消