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. B&W bitmap ???

B&W bitmap ???

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
4 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.
  • C Offline
    C Offline
    CaesarCZ
    wrote on last edited by
    #1

    Hi! I need a safe way to acquire a colored bitmap... Now, I do it like hDC = CreateCompatibleDC(NULL) hBitmap = CreateBitmap(params...hDC...) but it's still B&W any ideas? Thanks! PS: running 98 if you find this relevant. No window handle available

    T 1 Reply Last reply
    0
    • C CaesarCZ

      Hi! I need a safe way to acquire a colored bitmap... Now, I do it like hDC = CreateCompatibleDC(NULL) hBitmap = CreateBitmap(params...hDC...) but it's still B&W any ideas? Thanks! PS: running 98 if you find this relevant. No window handle available

      T Offline
      T Offline
      Todd Smith
      wrote on last edited by
      #2

      Can you post more or your code? What are you passing CreateBitmap for UINT cPlanes and UINT cBitsPerPel? Todd Smith

      C 1 Reply Last reply
      0
      • T Todd Smith

        Can you post more or your code? What are you passing CreateBitmap for UINT cPlanes and UINT cBitsPerPel? Todd Smith

        C Offline
        C Offline
        CaesarCZ
        wrote on last edited by
        #3

        CreateBitmap( width, height, GetDeviceCaps( hTempDC, PLANES ), GetDeviceCaps( hTempDC, BITSPIXEL ), NULL ); and I get the dc like hTempDC = CreateCompatibleDC(NULL)

        T 1 Reply Last reply
        0
        • C CaesarCZ

          CreateBitmap( width, height, GetDeviceCaps( hTempDC, PLANES ), GetDeviceCaps( hTempDC, BITSPIXEL ), NULL ); and I get the dc like hTempDC = CreateCompatibleDC(NULL)

          T Offline
          T Offline
          Todd Smith
          wrote on last edited by
          #4

          Check what GetDeviceCaps( hTempDC, PLANES ) and GetDeviceCaps( hTempDC, BITSPIXEL ) are returning. I suspect GetDeviceCaps( hTempDC, BITSPIXEL ) is not 8 or greater which is required for a color image. If you want a 256 color image then use 8 otherwise use 24. Todd Smith

          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