Results 1 to 10 of 10

Thread: Saving HDC to File

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241

    Saving HDC to File

    Is there any way I can save a HDC to a file such as a .gif, .bmp, .jpg or anything else along that line? In VB there is a function SavePicture. Is there anything like this for C++?

    thx in advance

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    It's a lot more complex than calling Picture1.SavePicture...

    Here is a discussion - note that some functions the poster refers to are in another post on the same board. They are code he wrote - like WRITEtoDIB()

    http://codeguru.earthweb.com/bitmap/..._to_file.shtml

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    It's quite easy with GDI+.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You limit your options a bit there, though.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yes, that is true. But not more than SaveImage would do.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    True.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241
    is there a way to do this without MFC?

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    GDI+ != MFC.

    You can do it, you just need to use a memory DC, then save the data to a DIB file

    MSDN is your friend...
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241
    could u give me the link to find this on msdn?

  10. #10

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