Enhancing Bob Powell example

  • Thread starter Thread starter Rene
  • Start date Start date
R

Rene

Bob Powell has a code example called "Capturing the screen or the surface of
a control" found here:

http://www.bobpowell.net/capture.htm

I would like to know what in the world do I have to add to this code so that
the surface of the control is also captured even if there is another control
covering it.

Thank you. Please help!!!!!
 
Rene,

I don't believe you can do that, unless you actually hide the control on
top of it. The windows manager knows the z order of the windows, and
doesn't have the window render that part of itself.

Hope this helps.
 
I am looking at the DrawToBitmap() function inplemented by the Control class
and that funciton does return the complete surface even if there are
controls on top of it, how do they do that?

In case you are wondering why I don't use that functino if it already does
what I want is because the stupid Web Browser control has that function but
it does not work and of course the control that I need to snap-shot is a Web
Browser control.



Nicholas Paldino said:
Rene,

I don't believe you can do that, unless you actually hide the control
on top of it. The windows manager knows the z order of the windows, and
doesn't have the window render that part of itself.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rene said:
Bob Powell has a code example called "Capturing the screen or the surface
of a control" found here:

http://www.bobpowell.net/capture.htm

I would like to know what in the world do I have to add to this code so
that the surface of the control is also captured even if there is another
control covering it.

Thank you. Please help!!!!!
 
Rene,

It appears that it creates a new bitmap and then gets the device context
for that bitmap. Then, what it does is call SendMessage, passing the handle
to the device context, as well as the WM_PRINT message, which tells the
control to draw itself to the device context.

Check out my response in an earlier thread (way earlier) which shows how
you can get the thumbnail image (of any size) from the WebBrowser control:

http://groups.google.com/group/micr...+author:Paldino&rnum=1&hl=en#aac571f730e13a25


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rene said:
I am looking at the DrawToBitmap() function inplemented by the Control
class and that funciton does return the complete surface even if there are
controls on top of it, how do they do that?

In case you are wondering why I don't use that functino if it already does
what I want is because the stupid Web Browser control has that function
but it does not work and of course the control that I need to snap-shot is
a Web Browser control.



Nicholas Paldino said:
Rene,

I don't believe you can do that, unless you actually hide the control
on top of it. The windows manager knows the z order of the windows, and
doesn't have the window render that part of itself.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rene said:
Bob Powell has a code example called "Capturing the screen or the
surface of a control" found here:

http://www.bobpowell.net/capture.htm

I would like to know what in the world do I have to add to this code so
that the surface of the control is also captured even if there is
another control covering it.

Thank you. Please help!!!!!
 
Back
Top