Jump to content

Writting code to take ScreenShots (C++)


Recommended Posts

Hey everyone...i'm trying to write a C++ program that will pretty much run in the background and will take a screenshot whenever the user presses a certain key. But the big thing that i want the program to do is read in a number from a file (this number is to be used to keep track of naming the screen shots), take the screen shot when they press the defined key, and then automatically save it into the directory the program is running from. i've got all the code written accept for the actual code that takes the screen shot. i can't seem to figure it out. anyone care to help?

main()

{

read in number from file

while(true)

{

if getasynckeystate(key)

{

screenshot();

increment number

}

if getasynckeystate(vk_escape)

break;

}

output new number

exit

}

basically i need to know what i should do in screenshot().

i've actually made a class called ScreenShot, so that if i come up with any other cool ideas i can just throw them in a function inside of it. well, any help would be much appreciated. thanks!

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...