Screenshots not working

This is a discussion on Screenshots not working within the A Brief History of Cprogramming.com forums, part of the Community Boards category; When I try to take a screenshot of DOS programs or videos that WMP is playing, I get nothing. With ...

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,678

    Screenshots not working

    When I try to take a screenshot of DOS programs or videos that WMP is playing, I get nothing. With DOS, it's just a black screen. And with videos begin played by WMP, it's dark purple where the video frames should be drawn.

    Is there some way for me to get exactely what I see, including the cursor? I tried GetPixel(), but it comes up with the same result PrtSc does. I don't mind coding it, and I don't mind not.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    WMP is using video overlays. It draws its playback area in a key colour, and the graphics card replaces the key with the video content.

    DOS ... are you talking about a fullscreen console?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    The only way you could access the WMP data is if you can get to the overlay layer in the graphics card. I know there are DirectX (not sure if it's part of Direct3D or some other part tho') that can write to overlay, but I'm not sure if they can also read back from the overlay. Note also that the overlay may not be in RGB, but in YUV format or some such.

    If the DOS screen is in full-screen mode, then Windows has no knowledge of it's content, it's been set up by the VGA BIOS, and Windows itself has no direct control over the graphical content. The content is also not in pixels in this mode, but stored as two bytes of attribute byte 1 and characater byte 0.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    I don't mind coding it, and I don't mind not.
    Do you mean, "It doesn't matter if I have to code it myself, or if I can use an existing library or function", or "It doesn't matter if I code it myself, or if I do it manually without writing any code"?

    If the latter, consider pressing ALT-ENTER to toggle a fullscreen DOS console into windowed mode. (Assuming it's a "DOS" application running in a command prompt, and not a real DOS program.) You should be able to printscreen it then.

    including the cursor?
    Press printscreen when the cursor is on the screen. You should be able to get it after a few tries.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    As for the video, look for a hardware acceleration disable option.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    Registered User
    Join Date
    Nov 2004
    Location
    India
    Posts
    515
    You can use something like fraps
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  7. #7
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    WMP is using video overlays. It draws its playback area in a key colour, and the graphics card replaces the key with the video content.
    Something you can to do with the key color is to change your dos window (or whatever
    window) background to that color (16, 0, 16 on my computer) and you can see the video
    "through" the window.

    Quote Originally Posted by CornedBee View Post
    As for the video, look for a hardware acceleration disable option.
    Thanks for that tip. It works on my WinXP and (old!) graphics card.
    Here's a pic of the setting I changed and the resulting pic of WMP:
    Attached Images Attached Images  

  8. #8
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    If you have the gimp, it has a screenshot filter that works with overlay video. you just click and drag the cursor from the "File | Aquire | Screenshot" onto the video and you will have a nice image that you can crop out.

  9. #9
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,678
    Thanks for the responces. The hardware acceleration thing sounds good.
    I think I'm out of luck with the fullscreen consol programs. Alt-Enter (and others) all just minimize it, and winspy++ says that the window is a couple pixels wide/high, and sitting at somthing like -2000 x -2000.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,918
    Disabling hardware acceleration is typically a very bad thing since that means graphics won't be done in hardware.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    If you do it temporarily just to get a still from a movie, I think the problems are manageable.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  12. #12
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,918
    I agree, but then you have to remember setting it back, so other methods might be preferable before restoring to it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function not working
    By sloopy in forum C Programming
    Replies: 31
    Last Post: 11-12-2005, 08:08 PM
  2. Program Not working Right
    By raven420smoke in forum C++ Programming
    Replies: 2
    Last Post: 09-16-2005, 04:21 AM
  3. Trying to eject D drive using code, but not working... :(
    By snowfrog in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2005, 08:47 PM
  4. x on upper right corner not working
    By caduardo21 in forum Windows Programming
    Replies: 1
    Last Post: 02-20-2005, 08:35 PM
  5. cygwin -> unix , my code not working properly ;(
    By CyC|OpS in forum C Programming
    Replies: 4
    Last Post: 05-18-2002, 05:08 AM

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