本文介绍了.NET TIFF文件:RGB无需第三方库CMYK转换可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
跟进我刚才的问题:是否以及如何将有可能采取基于RGB的文件并将它们转换成用以上标准.NET(3.5)功能,以CMYK?
Following up my previous question: if and how would it be possible to take RGB based TIFF files and convert them over to CMYK with standard .NET (3.5) functionality?
这是可能的呢?
推荐答案
其实,有使用System.Windows.Media.Imaging命名空间
只似乎与目前的TIFF正常工作(采用方式是为我好):
Actually there is a way using the System.Windows.Media.Imaging namespace which only seems to work properly with TIFFs at the moment (which is fine for me):
Stream imageStream = new
FileStream(@"C:\temp\mike4.jpg", FileMode.Open, FileAccess.Read, FileShare.Read);
BitmapSource myBitmapSource = BitmapFrame.Create(imageStream);
FormatConvertedBitmap newFormatedBitmapSource = new FormatConvertedBitmap();
newFormatedBitmapSource.BeginInit();
newFormatedBitmapSource.Source = myBitmapSource;
newFormatedBitmapSource.DestinationFormat = PixelFormats.Cmyk32;
newFormatedBitmapSource.EndInit();
BitmapEncoder encoder = new TiffBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(newFormatedBitmapSource));
Stream cmykStream = new FileStream(@"C:\temp\mike4_CMYK.tif",
FileMode.Create, FileAccess.Write, FileShare.Write);
encoder.Save(cmykStream);
cmykStream.Close();
请参阅的,由卡莱Mellergardh答案。
See "Converting images from RGB to CMYK", the answer by Calle Mellergardh.
这篇关于.NET TIFF文件:RGB无需第三方库CMYK转换可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!