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. Where do i specify the colors in a bitmpa picture?

Where do i specify the colors in a bitmpa picture?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsdata-structuresquestion
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.
  • R Offline
    R Offline
    redeemer
    wrote on last edited by
    #1

    If i want to save a bitmap to the disk, i first write BITMAPFILEHEADER struct to the disk and then a BITMAPINFO struct, but where do i specify the colors? I have an array of RGBQUAD's that contain all the colors but where do i specify them? Thanks

    C 1 Reply Last reply
    0
    • R redeemer

      If i want to save a bitmap to the disk, i first write BITMAPFILEHEADER struct to the disk and then a BITMAPINFO struct, but where do i specify the colors? I have an array of RGBQUAD's that contain all the colors but where do i specify them? Thanks

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      the palette comes after the BITMAPINFOHEADER struct and before the pixel data -c


      Garbage collection, making life better - for weenies!

      Image Processing - just like mom used to make.

      R 1 Reply Last reply
      0
      • C Chris Losinger

        the palette comes after the BITMAPINFOHEADER struct and before the pixel data -c


        Garbage collection, making life better - for weenies!

        Image Processing - just like mom used to make.

        R Offline
        R Offline
        redeemer
        wrote on last edited by
        #3

        What is a palette, and in what struct to i specify the pixel data? Thanks in advance.

        C 1 Reply Last reply
        0
        • R redeemer

          What is a palette, and in what struct to i specify the pixel data? Thanks in advance.

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          a palette is what you use to define the colors for a colormapped image (1,4 or 8 bits per pixel). if you're writing a 24 or 32 bpp BMP/DIB, you don't need a palette. in a BMP/DIB, the palette is the set of (up to) 256 RGBQUADs after the BITMAPINFOHEADER. after that comes the image data, formatted in any of a dozen or more ways, depending on bit depth, compression , JPG , PNG, etc.. -c


          Garbage collection, making life better - for weenies!

          Image Processing - just like mom used to make.

          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