收录日期:2019/02/17 00:12:59 时间:2010-06-16 19:15:50 标签:c++,windows,visual-c++,image

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.