Screenshots

This is a discussion on Screenshots within the Windows Programming forums, part of the Platform Specific Boards category; When you send WM_PAINT or any other method of taking a screenshot, will it always come down to calling BitBlt, ...

  1. #1
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034

    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

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    You should be able to call GetPixel() which would allow you to avoid calling BitBlt. I'm willing to bet this is slower though.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    137
    You never send WM_PAINT.
    The best method is with DX.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    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

  5. #5
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New screenshots from engine
    By VirtualAce in forum Game Programming
    Replies: 48
    Last Post: 11-30-2004, 08:30 PM
  2. screenshots of your games
    By stallion in forum Game Programming
    Replies: 94
    Last Post: 03-26-2003, 07:56 PM
  3. screenshots before a window pops up?
    By MadHatter in forum Game Programming
    Replies: 13
    Last Post: 12-31-2002, 10:09 AM
  4. Screenshots in RealOne
    By harryP in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 10-05-2002, 01:30 PM
  5. Screenshots of Upcoming "Mists of Avalon"
    By harry_p in forum C++ Programming
    Replies: 62
    Last Post: 08-02-2002, 11:37 AM

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