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
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
You should be able to call GetPixel() which would allow you to avoid calling BitBlt. I'm willing to bet this is slower though.
You never send WM_PAINT.
The best method is with DX.
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
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