How to identify CMYK images using C#

后端 未结 3 826
我在风中等你
我在风中等你 2020-12-31 01:32

Does anybody know how to properly identify CMYK images using C#? I found how to do it using ImageMagick, but I need a .NET solution. I found 3 code snippets online, only one

3条回答
  •  死守一世寂寞
    2020-12-31 02:15

    I wouldn't start with BitmapImage as your way of loading the data. In fact, I wouldn't use it at all for this. Instead I would use BitmapDecoder::Create and pass in BitmapCreateOptions.PreservePixelFormat. Then you can access the BitmapFrame you're interested in and check its Format property which should now yield CMYK.

    Then, if you really need to display the image, you can just assign the BitmapFrame, which is also a BitmapSource subclass, to an Image::Source.

提交回复
热议问题