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. Very very Urgent : Getting the color value of a pixel for 16-bpp bitmap

Very very Urgent : Getting the color value of a pixel for 16-bpp bitmap

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
2 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.
  • U Offline
    U Offline
    uday kiran janaswamy
    wrote on last edited by
    #1

    Im using a 16-Bpp Bitmap, With biCompression = BI_BITFIELDS. Im trying to get a color at a pixel in this bitmap. Im reading the pixel data and applying the Masks in the BmpInfoHeader and calculating the color value. The color value obtained this way is different from the color obtained using GetPixel() after rendering the Bitmap on screen using SetDIBitStoDevice(). Why is it so? Thanks in advance.

    Uday kiran

    C 1 Reply Last reply
    0
    • U uday kiran janaswamy

      Im using a 16-Bpp Bitmap, With biCompression = BI_BITFIELDS. Im trying to get a color at a pixel in this bitmap. Im reading the pixel data and applying the Masks in the BmpInfoHeader and calculating the color value. The color value obtained this way is different from the color obtained using GetPixel() after rendering the Bitmap on screen using SetDIBitStoDevice(). Why is it so? Thanks in advance.

      Uday kiran

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I guess to answer this, we need to know how they differ, and how you're doing your calculation. Do you realise that the color is stored within the bitmap as BGR, not RGB ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      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