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. Bitmap Question

Bitmap Question

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicsdata-structureshelptutorial
4 Posts 3 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.
  • N Offline
    N Offline
    Nick Armstrong
    wrote on last edited by
    #1

    I have a doc/view program (sdi) and I want to be able to load and display bitmaps on the fly from .bmp files. I have an array of cells that the document keeps track of and I want the view to draw the correct bitmap who's filename will be stored in the cell object so that when OnDraw is called it looks up which bitmap it should be displaying and loads and displays it, opposed to having the bitmaps as resources. I have gathered that to load a specific bitmap you use the code... HBITMAP hImage = (HBITMAP)LoadImage(NULL, "c:\\nick.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_DEFAULTSIZE); but I cannot work out how to display it because everything I blit to the screen is blank. I've checked and the bitmap is loading ok, just not displaying. How do you do this? Cheers for any help Nick :confused:

    J N 2 Replies Last reply
    0
    • N Nick Armstrong

      I have a doc/view program (sdi) and I want to be able to load and display bitmaps on the fly from .bmp files. I have an array of cells that the document keeps track of and I want the view to draw the correct bitmap who's filename will be stored in the cell object so that when OnDraw is called it looks up which bitmap it should be displaying and loads and displays it, opposed to having the bitmaps as resources. I have gathered that to load a specific bitmap you use the code... HBITMAP hImage = (HBITMAP)LoadImage(NULL, "c:\\nick.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_DEFAULTSIZE); but I cannot work out how to display it because everything I blit to the screen is blank. I've checked and the bitmap is loading ok, just not displaying. How do you do this? Cheers for any help Nick :confused:

      J Offline
      J Offline
      jerry0davis
      wrote on last edited by
      #2

      Try A DIBSection wrapper for Win32 and WinCE :)

      N 1 Reply Last reply
      0
      • J jerry0davis

        Try A DIBSection wrapper for Win32 and WinCE :)

        N Offline
        N Offline
        Nick Armstrong
        wrote on last edited by
        #3

        Thx a lot, looks like this'll work Nick :-D

        1 Reply Last reply
        0
        • N Nick Armstrong

          I have a doc/view program (sdi) and I want to be able to load and display bitmaps on the fly from .bmp files. I have an array of cells that the document keeps track of and I want the view to draw the correct bitmap who's filename will be stored in the cell object so that when OnDraw is called it looks up which bitmap it should be displaying and loads and displays it, opposed to having the bitmaps as resources. I have gathered that to load a specific bitmap you use the code... HBITMAP hImage = (HBITMAP)LoadImage(NULL, "c:\\nick.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_DEFAULTSIZE); but I cannot work out how to display it because everything I blit to the screen is blank. I've checked and the bitmap is loading ok, just not displaying. How do you do this? Cheers for any help Nick :confused:

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          An option I have used is using IPicture. It has a Render method that takes dc to draw the image onto. You can use gif, jpg, bmp, etc. Look in MSDN "How To Load and Display Graphics Files w/LOADPIC.EXE Q218972".

          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