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 create a dynamic bitmap ?

How to create a dynamic bitmap ?

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicstutorial
5 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.
  • O Offline
    O Offline
    Ohad Cabiri
    wrote on last edited by
    #1

    hello, I want to create a dynamic Bitmap (size + data), what is the way doing this? I try to use CreateBitmap without big success. Thanks.

    H A M 3 Replies Last reply
    0
    • O Ohad Cabiri

      hello, I want to create a dynamic Bitmap (size + data), what is the way doing this? I try to use CreateBitmap without big success. Thanks.

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Can you more explain about create a dynamic Bitmap


      WhiteSky


      1 Reply Last reply
      0
      • O Ohad Cabiri

        hello, I want to create a dynamic Bitmap (size + data), what is the way doing this? I try to use CreateBitmap without big success. Thanks.

        A Offline
        A Offline
        Akt_4_U
        wrote on last edited by
        #3

        Please use the following code if u can use MFC. UINT BITS_IN_A_BYTE = 8; CBitmap BlankBmp; BYTE *pbyBits = 0; SIZE_T nBits; nBits = m_uImgWidth * m_uImgHeight; pbyBits = new BYTE[nBits + UNITY]; if( 0 == pbyBits ) { return; } // Fill it with Black RGB values (R=0, G=0, B=0) ZeroMemory( pbyBits, nBits + UNITY ); BlankBmp.CreateBitmap( m_uImgWidth, m_uImgHeight, 1, BITS_IN_A_BYTE, pbyBits ); delete[] pbyBits;

        akt

        1 Reply Last reply
        0
        • O Ohad Cabiri

          hello, I want to create a dynamic Bitmap (size + data), what is the way doing this? I try to use CreateBitmap without big success. Thanks.

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

          Using Win32 APIs or MFC? Do you want a DIB, DDB, or a DIB section? How many bits per pixel? Mark

          "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

          O 1 Reply Last reply
          0
          • M Mark Salsbery

            Using Win32 APIs or MFC? Do you want a DIB, DDB, or a DIB section? How many bits per pixel? Mark

            "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

            O Offline
            O Offline
            Ohad Cabiri
            wrote on last edited by
            #5

            What is the diffrent between the above ? I need 32 bits per pixel (or 24). Thanks

            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