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. How to save a bitmap in Visual c++ (mfc)?

How to save a bitmap in Visual c++ (mfc)?

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicstutorialquestion
3 Posts 3 Posters 3 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
    Sakthi Gs
    wrote on last edited by
    #1

    Hi Sakthi here.... Could any one tell me the steps : How to save a bitmap in Visual C++ (mfc)..

    I R 2 Replies Last reply
    0
    • S Sakthi Gs

      Hi Sakthi here.... Could any one tell me the steps : How to save a bitmap in Visual C++ (mfc)..

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      The steps.... The good way is to learn how to load them first, reading all about BITMAPINFOHEADER. The information starts from there. That's if you want a learning experience, and wish to become a better programmer. Once you've done that, the lazy (and still good) way is to read articles like: CxImage[^] here on codeproject, in the graphics section. Iain.

      I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]

      1 Reply Last reply
      0
      • S Sakthi Gs

        Hi Sakthi here.... Could any one tell me the steps : How to save a bitmap in Visual C++ (mfc)..

        R Offline
        R Offline
        ravidborse
        wrote on last edited by
        #3

        HBITMAP hBmp; CBitmap bmp; CBitmap *pOldbmp; BITMAP bi; CDC bmDC; hBmp = (HBITMAP)::LoadImage(NULL,"E:\\Deharadun.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION); if(hBmp==NULL) MessageBox("Bitmap Failed"); bmp.Attach(hBmp); CClientDC dc(this); bmDC.CreateCompatibleDC(&dc); pOldbmp = bmDC.SelectObject(&bmp); bmp.GetBitmap(&bi); dc.BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY); bmDC.SelectObject(pOldbmp); copy same code u can open bitmap file to save bitmap file u have to look for same function as shoown in baove code

        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