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. Can I construct CBitmap from heap

Can I construct CBitmap from heap

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 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.
  • M Offline
    M Offline
    m1m2
    wrote on last edited by
    #1

    Hi, I download a '.bmp' file through internet and save bits in the heap like char*, can I create CBitmap without save file to disk. :)

    M 1 Reply Last reply
    0
    • M m1m2

      Hi, I download a '.bmp' file through internet and save bits in the heap like char*, can I create CBitmap without save file to disk. :)

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Is CBitmap really what you want?  CBitmaps are device-depentent bitmaps (DDB) while a .bmp is device independent bitmap (DIB).  You can convert bitmaps from whatever type to whatever other type, but you need to specify what type you want the resulting bitmap to be. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      M 1 Reply Last reply
      0
      • M Mark Salsbery

        Is CBitmap really what you want?  CBitmaps are device-depentent bitmaps (DDB) while a .bmp is device independent bitmap (DIB).  You can convert bitmaps from whatever type to whatever other type, but you need to specify what type you want the resulting bitmap to be. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        M Offline
        M Offline
        m1m2
        wrote on last edited by
        #3

        I don't know : ) but i fix it, i save file on disk and read it from there. Furst i try to separate data from header in .bmp file, because i saw one function which draw on dc directly from data bits of .bmp, but something get wrong and save it on the disk. work fine now.

        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