C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-06-2009, 12:41 AM   #1
Dae
Deprecated
 
Dae's Avatar
 
Join Date: Oct 2004
Location: Canada
Posts: 1,032
Smile Screenshots

When you send WM_PAINT or any other method of taking a screenshot, will it always come down to calling BitBlt, or is there another low-level function to use to take screenshots?

Thanks
__________________
Warning: Have doubt in anything I post.

GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101
Dae is offline   Reply With Quote
Old 07-07-2009, 09:39 AM   #2
Registered User
 
Join Date: Sep 2004
Location: California
Posts: 3,020
You should be able to call GetPixel() which would allow you to avoid calling BitBlt. I'm willing to bet this is slower though.
bithub is offline   Reply With Quote
Old 07-07-2009, 04:23 PM   #3
Registered User
 
Join Date: Apr 2007
Posts: 136
You never send WM_PAINT.
The best method is with DX.
Alex31 is offline   Reply With Quote
Old 07-07-2009, 10:21 PM   #4
train spotter
 
Join Date: Aug 2001
Location: near a computer
Posts: 3,448
You can get a screen shot at any time, not just in response to a WM_PAINT

Windows has a structure called a Device Context (DC) to hold info on the screen. The DC contains Graphical Device Interface (GDI) objects (ie pen, brush, font and bitmap).

To capture the screen you need to get a copy of the bitmap from the screen's DC.

BitBlt() gets the whole bmp in one copy.

GetPixel() can also be used but needs to be called for Height * Width (which is slower and more complex).

I suggest a search here for code on screen shots, we have answered most questions before (and there is plenty of code).

Quote:
Originally Posted by Alex31 View Post
You never send WM_PAINT.
My apps generate WM_PAINT msgs any time I need the screen to change.

Quote:
Originally Posted by Alex31 View Post
The best method is with DX.
By DX to you mean Direct X?

I find GDI easier to use, as we only need to grab a bitmap.
__________________
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche

"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best

"If you are going through hell....keep going."
Winston Churchill
novacain is offline   Reply With Quote
Old 07-08-2009, 01:21 AM   #5
Dae
Deprecated
 
Dae's Avatar
 
Join Date: Oct 2004
Location: Canada
Posts: 1,032
Thanks bithub.

Appreciate the answers guys.
__________________
Warning: Have doubt in anything I post.

GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101
Dae is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New screenshots from engine Bubba Game Programming 48 11-30-2004 09:30 PM
screenshots of your games stallion Game Programming 94 03-26-2003 08:56 PM
screenshots before a window pops up? MadHatter Game Programming 13 12-31-2002 11:09 AM
Screenshots in RealOne harryP A Brief History of Cprogramming.com 6 10-05-2002 01:30 PM
Screenshots of Upcoming "Mists of Avalon" harry_p C++ Programming 62 08-02-2002 11:37 AM


All times are GMT -6. The time now is 09:58 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22