how to get Bitsperpixel from a bitmap

后端 未结 6 1947
心在旅途
心在旅途 2021-02-18 12:41

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 th

6条回答
  •  梦毁少年i
    2021-02-18 13:16

    Rather than creating your own function, I'd suggest using this existing function in the framework:

    Image.GetPixelFormatSize(bitmap.PixelFormat)
    

提交回复
热议问题