I want to turn a screen shot from the clipboard into a array data (Red/Green/Blue) in my program. so i guess it's as simple as that. but i don't want to use anything else then the print screen and clipboard if i can?
anyway any questions just ask.
I want to turn a screen shot from the clipboard into a array data (Red/Green/Blue) in my program. so i guess it's as simple as that. but i don't want to use anything else then the print screen and clipboard if i can?
anyway any questions just ask.
You can call GetClipboardData
specifying (for example) CF_DIB
format, which will return a BITMAPINFO
structure followed immediately by an array of data for the pixels. The BITAMPINFO
structure will contain information (e.g., bits per pixel, size of image) to tell you how to interpret the pixel data.
Edit: Unless you're really intent on using the Print Screen key, it's probably easier to blit the data directly from the screen when you want it. This avoids blowing away whatever the user already had in the clipboard, and it's generally easier to do as well.