I have a 3rd party component which requires me to give it the bitsperpixel from a bitmap.
What’s the best way to get “bits per pixel”?
My starting point is the following blank method:-
public int GetBitsPerPixelMethod( system.drawing.bitmap bitmap )
{
//return BitsPerPixel;
}
Use the Pixelformat property, this returns a Pixelformat enumeration which can have values like f.e.
Format24bppRgb, which obviously is 24 bits per pixel, so you should be able to do something like this: