How to load a 24bpp bmp using C - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to load a 24bpp bmp using C

RatRat Posts: 8Member
I'm able to load 1,4,8bpp bmp files in DOS using C. I'm not able to load 24bpp bmp. I want the details about how to set the palette and put the pixel values for a 24bpp bmp.
Please help me
Thank you

Rat

Comments

  • gautamgautam Posts: 642Member
    I don't think a 24bpp has a palette. From what I know it might just be possible be able to convert a 24bpp to 8bpp. I am not sure though.

    : I'm able to load 1,4,8bpp bmp files in DOS using C. I'm not able to load 24bpp bmp. I want the details about how to set the palette and put the pixel values for a 24bpp bmp.
    : Please help me
    : Thank you
    :
    : Rat
    :

  • RatRat Posts: 8Member
    True. There is no palette values for 24bpp. We have the rgb values. How to set the pixels using that. I donot have any idea about that. Please help me.

    : I don't think a 24bpp has a palette. From what I know it might just be possible be able to convert a 24bpp to 8bpp. I am not sure though.
    :
    : : I'm able to load 1,4,8bpp bmp files in DOS using C. I'm not able to load 24bpp bmp. I want the details about how to set the palette and put the pixel values for a 24bpp bmp.
    : : Please help me
    : : Thank you
    : :
    : : Rat
    : :
    :
    :

  • cosmos_ggcosmos_gg Posts: 5Member
    That's very simple.
    first ,you need switch to a 24bit VESA mode.
    And you will be able to write in a linearly buffer,representating the VRAM. (so,that's an array of bytes like R G B R G B R G etc...
    So get info on the VESA!

    : True. There is no palette values for 24bpp. We have the rgb values. How to set the pixels using that. I donot have any idea about that. Please help me.
    :
    : : I don't think a 24bpp has a palette. From what I know it might just be possible be able to convert a 24bpp to 8bpp. I am not sure though.
    : :
    : : : I'm able to load 1,4,8bpp bmp files in DOS using C. I'm not able to load 24bpp bmp. I want the details about how to set the palette and put the pixel values for a 24bpp bmp.
    : : : Please help me
    : : : Thank you
    : : :
    : : : Rat
    : : :
    : :
    : :
    :
    :

  • RatRat Posts: 8Member
    Thank you. I'm able to do that.
    Regards
    Rat
    : That's very simple.
    : first ,you need switch to a 24bit VESA mode.
    : And you will be able to write in a linearly buffer,representating the VRAM. (so,that's an array of bytes like R G B R G B R G etc...
    : So get info on the VESA!
    :
    : : True. There is no palette values for 24bpp. We have the rgb values. How to set the pixels using that. I donot have any idea about that. Please help me.
    : :
    : : : I don't think a 24bpp has a palette. From what I know it might just be possible be able to convert a 24bpp to 8bpp. I am not sure though.
    : : :
    : : : : I'm able to load 1,4,8bpp bmp files in DOS using C. I'm not able to load 24bpp bmp. I want the details about how to set the palette and put the pixel values for a 24bpp bmp.
    : : : : Please help me
    : : : : Thank you
    : : : :
    : : : : Rat
    : : : :
    : : :
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.