Thread: How to get image from the screen and then save it to a file?

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    16

    How to get image from the screen and then save it to a file?

    I want to clip a rectangle box from the desktop and save the pixels as an image. Then save the image to a file.

    So there are 2 questions:

    1. what's the efficient way to get the pixels in a rectangle box on the screen? Using GetPixel in for loops is the only thing I know.

    2. I want to save the image to a file. I guess saving it to .bmp is the easist, but what is the format of bmp? It would be better if I can compress it in any way with a few lines of code, BTW, I am programming in C++.

    Thanks in advance!

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    16
    Thanks for the fast and great reply!

Popular pages Recent additions subscribe to a feed