CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2009
    Location
    Tartu, Estonia
    Posts
    11

    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?

  2. #2
    Join Date
    Mar 2009
    Location
    Riga, Latvia
    Posts
    128

    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.

  3. #3
    Join Date
    Jul 2009
    Location
    Tartu, Estonia
    Posts
    11

    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?

  4. #4
    Join Date
    Mar 2009
    Location
    Riga, Latvia
    Posts
    128

    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

  5. #5
    Join Date
    Mar 2009
    Location
    Riga, Latvia
    Posts
    128

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured