本文介绍了在WPF / XAML中使用CMYK颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何方法可以直接在XAML文档中指定 CMYK 颜色?
前缀为#字符将创建RGB颜色,
- 问题是不要将从CMYK转换为RGB,而使用真实的CMYK
- 目的是允许生成 XPS 文档(使用System.Windows .Xps.Packaging)将颜色视为CMYK,并生成颜色代码为ContextColor /swopcmykprofile.icc a,b,c,d,e而不是#aarrggbb
我试图通过使用ColorContext没有任何成功定义CMYK颜色。
解决方案
再次确认!
原来比我更容易:
CMYK可直接在XAML中使用:
< Grid Background =ContextColor file:// C:/WINDOWS/system32/spool/drivers/color/EuroscaleCoated.icc 1.0,0.0,0.0,1.0,1.0>
Is there any way to specify CMYK colours directly in a XAML document?
prefixing them with # character will create RGB colours, but how to specify a CMYK colour?
Some notes:
- The question is NOT about converting from CMYK to RGB but to use real CMYK
- The purpose is to allow generated XPS documents (using System.Windows.Xps.Packaging for example) see the colour as CMYK and generate colour codes as "ContextColor /swopcmykprofile.icc a,b,c,d,e" not as "#aarrggbb"
I have tried to define CMYK colours by using ColorContext without any success.
解决方案
OK again!It turned out to be much more easier than what I though:CMYK is directly usable in XAML:
<Grid Background="ContextColor file://C:/WINDOWS/system32/spool/drivers/color/EuroscaleCoated.icc 1.0,0.0,0.0,1.0,1.0">
这篇关于在WPF / XAML中使用CMYK颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!