How to find how many bits are used by a given BMP image for color display?


  • Hello all:


    Given a bitmap image as follows:


    Bitmap m_Bitmap = (Bitmap)Bitmap.FromFile(@"c:\t.png", false);


    I could find out the PixelFormat with m_Bitmap.PixelFormat.


    However, I would like to know how many bits are used for color display.


    For example:


    If the created bitmap is of Format24bppRgb, then it uses 24 bits.


    Is it possible that I can find the number of bits used by Bitmap directly?



    Thank you



    Wednesday, August 29, 2007 5:53 PM