框架:.NET Core3.1
第三方类库:无
/// <summary>
/// 判断图片的色彩模式是否是CMYK
/// </summary>
/// <returns></returns>
public bool IsCmyk()
{
System.Drawing.Image img = Bitmap.FromFile(SourceFileSelectValue, true);
PixelFormat pf = (PixelFormat)img.PixelFormat;
if (pf.ToString() == "8207")
return true;
else
return false;
}