Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Saving a BITMAP

Saving a BITMAP

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicshelptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    spen11
    wrote on last edited by
    #1

    Hi all, I have created a (very simple) bitmap editing program with a dialog based MFC project. Everything seems in order so far but I don't know how to save the HBITMAPs that I have created to file. I have tried using snippets of code from other examples but to no avail. Any help would be much appreciated :-D

    R V L 3 Replies Last reply
    0
    • S spen11

      Hi all, I have created a (very simple) bitmap editing program with a dialog based MFC project. Everything seems in order so far but I don't know how to save the HBITMAPs that I have created to file. I have tried using snippets of code from other examples but to no avail. Any help would be much appreciated :-D

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      Is it not possible to serialize your bitmap ? Create a CBitmap from your handle HBITMAP using CBitmap::FromHandle, then Serialize it. ~RaGE();

      1 Reply Last reply
      0
      • S spen11

        Hi all, I have created a (very simple) bitmap editing program with a dialog based MFC project. Everything seems in order so far but I don't know how to save the HBITMAPs that I have created to file. I have tried using snippets of code from other examples but to no avail. Any help would be much appreciated :-D

        V Offline
        V Offline
        Vipin Aravind
        wrote on last edited by
        #3

        If it is a DDB(device dependent bitmap) use GetDIBits(...) on the HBITMAP and get the DIB with the format of your choice specified via the BITMAPINFO. Once got the DIB bits, you can save to the file by putting the BITMAPFILEHEADER,BITMAPINFO and the bits itself to a file in that sequence. Vipin - MVP

        1 Reply Last reply
        0
        • S spen11

          Hi all, I have created a (very simple) bitmap editing program with a dialog based MFC project. Everything seems in order so far but I don't know how to save the HBITMAPs that I have created to file. I have tried using snippets of code from other examples but to no avail. Any help would be much appreciated :-D

          L Offline
          L Offline
          Laxman9
          wrote on last edited by
          #4

          Here is the link of codeproject that may help you for saving the bitmap. http://www.codeproject.com/bitmap/drawing2bitmap.asp Thanks and Regards Laxman FAILURE is the first step towards SUCCESS :cool:

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups