BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

copy window to bitmap? - no WinAPI

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Robert G. Hoover
Guest





PostPosted: Wed Dec 14, 2005 1:12 pm    Post subject: copy window to bitmap? - no WinAPI Reply with quote



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





PostPosted: Wed Dec 14, 2005 2:04 pm    Post subject: Re: copy window to bitmap? - no WinAPI Reply with quote



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





PostPosted: Wed Dec 14, 2005 5:34 pm    Post subject: Re: copy window to bitmap? - no WinAPI Reply with quote



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





PostPosted: Wed Dec 14, 2005 7:26 pm    Post subject: Re: copy window to bitmap? - no WinAPI Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.