Getting image from the clipboard and then saving it into a image file.
How to Get an image from the clipboard and then save it into a image file?
Re: Getting image from the clipboard and then saving it into a image file.
Use WinAPI functions OpenClipboard(), CloseClipboard(), GetClipboardData() to deal with clipboard. You'll probably need to work with bitmap then.
Re: Getting image from the clipboard and then saving it into a image file.
A n00b needs more help here:
#include <windows.h>
int main()
{
OpenClipboard(NULL);
GetClipboardData(CF_BITMAP);
return 0;
}
What now?
Re: Getting image from the clipboard and then saving it into a image file.
1) I would write smth like this:
Code:
HBITMAP hBitmap = (HBITMAP)GetClipboardData(CF_BITMAP);
2) Do you know what MSDN is?
If you have any questions first look through some articles there:http://msdn.microsoft.com/en-us/library/default.aspx
Re: Getting image from the clipboard and then saving it into a image file.
Well, then I advice you to try to look what's there in the bitmap handle. Output it to window.
Then find any bmp file format specification in the Internet and write bitmap to a file.
This is one my question I asked to make sure I know all the methods to access RGB:http://www.codeguru.com/forum/showth...61#post1860961
By the way I'm also working on a problem related to BMP.