![]() |
| | #1 |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| 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 | |
| | #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 | |
| | #3 |
| Registered User Join Date: Apr 2007
Posts: 136
| You never send WM_PAINT. The best method is with DX. |
| Alex31 is offline | |
| | #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). My apps generate WM_PAINT msgs any time I need the screen to change. 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 | |
| | #5 |
| Deprecated 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 | |
![]() |
| Thread Tools | |
| Display Modes | |
|
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 |