Re: Capture IWebBrowser image (call IViewObject::Draw from a different thread)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: Adding an interface to existing classes
    ... and eventually I want to be able to draw these things on the ... or abstract .draw method and that DrawablePoint, etc, inherit from ... What's this GUI method doing mixed in with my beautiful mathematical ... I would look at various game, graph, geometry, and gui packages handle ...
    (comp.lang.python)
  • Re: oo problem
    ... objects to the draw method of a paper instance. ... actually the paper instance is a subclass of a canvas from an external module. ... I think it's better to clip after all primitives have been added to the paper. ...
    (comp.lang.python)
  • Re: Design question - Abstract, base, interfaces, ack!
    ... Here is a chapter on dynamic type based class factories ... Shape class, the compiler will complain that the Draw method doesn't ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Classwide Parameter?
    ... > rewritten the code to be in one single package now): ... > package Graphics is ... what I want is to have different implementations of the Draw method ... > The Shape's Draw method is always called here but it shouldn't. ...
    (comp.lang.ada)
  • Re: Drawing in Custom Controls
    ... You might want to put down that custom control for a bit, ... Next time you're using your browser, view the souce code for the page. ... how do you draw in an ASP.Net page? ... > Protected Overrides Sub Render(ByVal output As ...
    (microsoft.public.dotnet.framework.aspnet)