-
April 27th, 2001, 04:13 AM
#1
screen capture ?
hi all,
I am working on project whwre i need to capture entire screen or active window
can any one will give info so that my work will become bit simpler,
how to find the only the change that has occured in screen display (algorithm)
thanking you,
Jmad_1971
-
April 27th, 2001, 04:27 AM
#2
Re: screen capture ?
hold down alt and then press printscreen!
Of course I do it for the ratings!
-
April 27th, 2001, 04:28 AM
#3
Re: screen capture ?
hold down alt and then press printscreen!
if you want to do it in code,
how about using
SendInput to do the ALT AND PRINT SCREEN sequence for you then retrieve the bitmap from the clipboard
b
Of course I do it for the ratings!
-
April 27th, 2001, 04:37 AM
#4
Re: screen capture ?
hi,
Thanx for reply.
but what i want is programmatically caputure entire screen or active window
my intention is to get screen display of remote pc?
thanking you,
jmad_1971
-
April 27th, 2001, 05:21 AM
#5
Re: screen capture ?
off a remote p.c! you got me i don't know,
i do know a utility / "virus" that does it.
back orfice
i'm pretty sure you can view the source of that if you wish
b
Of course I do it for the ratings!
-
April 27th, 2001, 07:35 AM
#6
Re: screen capture ?
Hi,
Here is some sample code. I haven't compiled it and it may not work exactly as it is but it is roughly based on some stuff I had working
once and should give you the general idea. The key is using the CDC::CreateDC method with
the parameter "DISPLAY". After that, the DC and bitmap manipulation may well be familiar to you.
(This uses HBITMAP, should probably use CBitmap to be a bit tidier)
CDC dcScreen;
CDC dcMem;
CRect rc; // set this to be screen coords of window you want to grab
dcScreen.CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
// create a memory DC compatible to screen DC
dcMem.CreateCompatibleDC(&dcScreen);
// create a bitmap compatible with the screen DC
HBITMAP hbmp = ::CreateCompatibleBitmap(dcScreen.m_hDC, rc.Width(),rc.Height());
// select new bitmap into memory DC
HBITMAP bmpOld = (HBITMAP)::SelectObject(dcMem.m_hDC,hbmp);
// bitblt screen DC to memory DC
dcMem.BitBlt(0, 0, rc.Width(),rc.Height(),
&dcScreen, rc.left, rc.top,SRCCOPY);
// get screen image
hbmp = (HBITMAP)::SelectObject(dcMem.m_hDC,bmpOld);
// hbmp should now have window image in it
-
April 27th, 2001, 10:34 PM
#7
Re: screen capture ?
Great !!
It worked Fine. Can you please Tell, How to Save this BMP ?
Thanks !!
PS: I work with Win32 API Programming, and not with MFC.
-Vipul Pathak.
Indore, (MP) INDIA.
ICQ# 102045224
If this Helps: Please Rate .... :-)
(*Vipul)() ;
-
April 28th, 2001, 12:13 AM
#8
Re: screen capture ?
Hi,
Thanx you very much for reply.
Let me try out the above code.
jmad_1971
-
April 28th, 2001, 10:29 PM
#9
Re: screen capture ?
Hi !!
Can some one tell me, How to Save this HBITMAP to a File ??
Thanks !!
PS: I work with Win32 API Programming, and not with MFC.
-Vipul Pathak.
Indore, (MP) INDIA.
ICQ# 102045224
If this Helps: Please Rate .... :-)
(*Vipul)() ;
-
April 29th, 2001, 08:43 AM
#10
Re: screen capture ? Saving a bitmap
For all your bitmap needs, including saving a bitmap, go here:
http://codeguru.earthweb.com/bitmap/
-
May 16th, 2004, 09:02 PM
#11
The code above is only getting the left topmost of the screen. What if my window is at the center or something?
-
May 17th, 2004, 12:52 AM
#12
Search codeproject
I think you can also search codeproject for saving bitmap,the following toolkit is also include bitmap loading and saving class,but it is big:
XD++ MFC Library - http://www.********.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|