如何检查,如果照片是在灰度 [英] How to check if a picture is in grayScale
本文介绍了如何检查,如果照片是在灰度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
我如何检查一个位图的颜色深度<? / A>
Possible Duplicate:
How can I check the color depth of a Bitmap?
我收到的图像的路径。我需要知道,如果那张照片是在灰度。我怎样才能做到这一点?
I'm receiving the path of a picture. I would need to know if that picture is in grayScale. How can I do this?
我试图加载路径使用此code位图,但它口口声声说我该参数是无效的。
I'm trying to load that path to a Bitmap using this code, but it keeps saying me that the parameter is not valid.
Bitmap myBitmap = new Bitmap(pFilePath);
我可以检查它是否是从灰阶的ByteArray?或者是有一些方法来从位图呢?怎么会是这样?
Can I check if it is in grayScale from a ByteArray? Or is there some way to do it from a Bitmap? How would that be?
感谢。
推荐答案
检查这个的属性
image.PixelFormat
这将匹配系统中的一个值。 Drawing.Imaging.PixelFormat
这篇关于如何检查,如果照片是在灰度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文