| View previous topic :: View next topic |
| Author |
Message |
Robert G. Hoover Guest
|
Posted: Wed Dec 14, 2005 1:12 pm Post subject: copy window to bitmap? - no WinAPI |
|
|
Hi All,
I've scoured the internet looking for a way to capture a window as a
bitmap and I've only found everyone capturing the "DESKTOP" and cropping
to the window dimensions. Plus, if the window is off the screen or
partially obscurred, the capture doesn't capture that part of the
window. Is there any way to capture a partially/fully obscurred window
as a bitmap? I was thinking of using a loop similar to the following....
// manually paint each child control into a TBitmap
for (int i = 0; i < ControlCount; i++)
{
// get access to children
TControl *SubControl = (TControl *)(Controls[i]);
// copy control canvas to TBitmap canvas???
...
}
Is this even possible? Has anyone experimented with this kind of approach?
Thanks!
Rob
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Wed Dec 14, 2005 2:04 pm Post subject: Re: copy window to bitmap? - no WinAPI |
|
|
Robert G. Hoover wrote:
| Quote: | ... Is there any way to capture a partially/fully obscurred window
as a bitmap? I was thinking of using a loop similar to the following....
|
Have a look at GetFormImage().
See thread "Print Form" in
borland.public.cppbuilder.vcl.components.using
The drawback of GetFormImage is that it will not display
the Text of a TComboBox. Also some other controls are handled
incorrect.
Hans.
|
|
| Back to top |
|
 |
Jonathan Benedicto Guest
|
Posted: Wed Dec 14, 2005 5:34 pm Post subject: Re: copy window to bitmap? - no WinAPI |
|
|
Robert G. Hoover wrote:
| Quote: | I've scoured the internet looking for a way to capture a window as a
bitmap and I've only found everyone capturing the "DESKTOP" and
cropping to the window dimensions. Plus, if the window is off the
screen or partially obscurred, the capture doesn't capture that part
of the window. Is there any way to capture a partially/fully obscurred
window
as a bitmap? I was thinking of using a loop similar to the
following....
|
Look up WM_PRINT or WM_PRINTCLIENT.
HTH
Jonathan
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Dec 14, 2005 7:26 pm Post subject: Re: copy window to bitmap? - no WinAPI |
|
|
"Robert G. Hoover" <not.a.real.address (AT) anywhere (DOT) sorry> wrote
| Quote: | I've scoured the internet looking for a way to capture a window
as a bitmap and I've only found everyone capturing the "DESKTOP"
and cropping to the window dimensions.
|
There are many examples of capturing a window without using the desktop at
all. Go to http://www.deja.com and do a search through the archives for
these newsgroups. The topic has been discussed many times before.
Gambit
|
|
| Back to top |
|
 |
|