Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Wed, 14 May 2008 19:07:21 -0400
predator_mf2000@xxxxxxxxx wrote:
On May 14, 6:19 pm, "Igor Tandetnik" <itandet...@xxxxxxxx> wrote:
I don't think it's going to work, for lots of different reasons. Why
do you believe you need that?
Are you saying it's not possible to use the Draw method in a separate
thread, or it's not going to be working faster ?
I believe it's impossible. I can't prove the negative, of course -
perhaps someone figured out how to do it. But WebBrowser is a
single-threaded component, not thread safe. Imagine you ask it to draw
right when it's updating some internal data structures.
The Draw method requires alot of time to execute (50-60ms depending on
the rectangle size of the object, the CPU speed, etc). Imagine I have
two objects like this and I call the Draw method for each of them - I
get 100ms delay in my render loop, so the fps are limited to 10fps. I
need the viewobject to draw asynchronously from the renderloop.
Why not do it the other way round: host each browser in its own worker
thread (which joins STA and runs a message pump), let these threads call
Draw and spend whatever it takes doing that. The main render loop would
use the most recent snapshot from each browser.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- From: predator_mf2000
- Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- References:
- Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- From: predator_mf2000
- Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- From: Igor Tandetnik
- Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- From: predator_mf2000
- Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- Prev by Date: Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- Next by Date: Re:How to make a Chevron on an IDeskBand toolbar
- Previous by thread: Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- Next by thread: Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)
- Index(es):
Relevant Pages
|
Loading