本文整理汇总了C++中ScColor::setCmykColorF方法的典型用法代码示例。如果您正苦于以下问题:C++ ScColor::setCmykColorF方法的具体用法?C++ ScColor::setCmykColorF怎么用?C++ ScColor::setCmykColorF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScColor
的用法示例。
在下文中一共展示了ScColor::setCmykColorF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importColorsFromFile
//.........这里部分代码省略.........
ColorEn = tsC.readLine();
bool cus = false;
if (ColorEn.contains("OpenOffice"))
cus = true;
if ((ColorEn.startsWith("<?xml version=")) || (ColorEn.contains("VivaColors")))
{
QByteArray docBytes("");
loadRawText(fileName, docBytes);
QString docText("");
docText = QString::fromUtf8(docBytes);
QDomDocument docu("scridoc");
docu.setContent(docText);
ScColor lf = ScColor();
QDomElement elem = docu.documentElement();
QString dTag = "";
dTag = elem.tagName();
QString nameMask = "%1";
nameMask = elem.attribute("mask", "%1");
QDomNode PAGE = elem.firstChild();
while (!PAGE.isNull())
{
QDomElement pg = PAGE.toElement();
if (pg.tagName()=="COLOR" && pg.attribute("NAME")!=CommonStrings::None)
{
if (pg.hasAttribute("SPACE"))
{
QString space = pg.attribute("SPACE");
if (space == "CMYK")
{
double c = pg.attribute("C", "0").toDouble() / 100.0;
double m = pg.attribute("M", "0").toDouble() / 100.0;
double y = pg.attribute("Y", "0").toDouble() / 100.0;
double k = pg.attribute("K", "0").toDouble() / 100.0;
lf.setCmykColorF(c, m, y, k);
}
else if (space == "RGB")
{
double r = pg.attribute("R", "0").toDouble() / 255.0;
double g = pg.attribute("G", "0").toDouble() / 255.0;
double b = pg.attribute("B", "0").toDouble() / 255.0;
lf.setRgbColorF(r, g, b);
}
else if (space == "Lab")
{
double L = pg.attribute("L", "0").toDouble();
double a = pg.attribute("A", "0").toDouble();
double b = pg.attribute("B", "0").toDouble();
lf.setLabColor(L, a, b);
}
}
else if (pg.hasAttribute("CMYK"))
lf.setNamedColor(pg.attribute("CMYK"));
else if (pg.hasAttribute("RGB"))
lf.fromQColor(QColor(pg.attribute("RGB")));
else
{
double L = pg.attribute("L", "0").toDouble();
double a = pg.attribute("A", "0").toDouble();
double b = pg.attribute("B", "0").toDouble();
lf.setLabColor(L, a, b);
}
if (pg.hasAttribute("Spot"))
lf.setSpotColor(static_cast<bool>(pg.attribute("Spot").toInt()));
else
lf.setSpotColor(false);
if (pg.hasAttribute("Register"))