我正在开发一个打印图像文件夹的应用程序,包括JPEG和TIFF.TIFF图像通常是黑白(1bpp).
加载图像后,我想确定图像是彩色还是黑白或灰度,这样我就可以将图像发送到正确的打印机(彩色打印机或黑白打印机).
我正在使用Bitmap构造函数image = new Bitmap(filename);来加载图像.
Bitmap
image = new Bitmap(filename);
编辑:检查像素深度的答案非常适合B&W.有关检查图像是否为灰度而不迭代每个像素的任何想法?
c# image bitmap color-depth bit-depth
bit-depth ×1
bitmap ×1
c# ×1
color-depth ×1
image ×1