本文整理汇总了C++中Style::IsFillOpacityDefined方法的典型用法代码示例。如果您正苦于以下问题:C++ Style::IsFillOpacityDefined方法的具体用法?C++ Style::IsFillOpacityDefined怎么用?C++ Style::IsFillOpacityDefined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Style
的用法示例。
在下文中一共展示了Style::IsFillOpacityDefined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OutputStyles
bool XARGenerator::OutputStyles(const Style& style, const Transformation& trans, const RectD& boundings, UINT32 witch)
{
bool ok = true;
CXaraFileRecord Rec(0);
wxString sXmlId = style.GetXmlId();
if (!sXmlId.IsEmpty()) {
// XXX how to output object labels in XAR?
#if SVGDEBUG
svgtrace(DBGTRACE_SHAPES, "object id: %s\n", (const char *)sXmlId.mb_str(wxConvUTF8));
#endif
}
// XXX TODO to avoid XAR redundancy, we should look
// if the styles we are outputting are already the default
// in Xara's stack
if (witch & STYLE_FILL_COLOUR) {
if (style.IsFillColourDefined()) {
wxColour col = style.GetFillColour();
if (col.Ok()) {
UINT32 iRecNo = DefineColour(col);
Rec.Reinit(TAG_FLATFILL, TAG_FLATFILL_SIZE);
ok = Rec.WriteReference(iRecNo);
ok = m_pExporter->WriteRecord(&Rec);
#if SVGDEBUG
svgtrace(DBGTRACE_STYLES, "fill colour %d,%d,%d\n", col.Red(), col.Green(), col.Blue());
#endif
} else {
m_pExporter->WriteZeroSizedRecord(TAG_FLATFILL_NONE);
#if SVGDEBUG
svgtrace(DBGTRACE_STYLES, "no fill colour\n");
#endif
}
} else if (!style.IsFillGradientDefined()) {
m_pExporter->WriteZeroSizedRecord(TAG_FLATFILL_NONE);
#if SVGDEBUG
svgtrace(DBGTRACE_STYLES, "no fill colour\n");
#endif
}
}
if (witch & STYLE_FILL_GRADIENT && style.IsFillGradientDefined()) {
Gradient* pGradient = style.GetFillGradient();
if (pGradient->type == Gradient::Linear) {
OutputFillLinearGradient(style, trans, boundings);
} else if (pGradient->type == Gradient::Radial) {
OutputFillRadialGradient(style, trans, boundings);
}
}
if (witch & STYLE_FILL_OPACITY && style.IsFillOpacityDefined()) {
double opacity = style.GetFillOpacity();
if (opacity < 1.0) {
BYTE bOpacity = (BYTE)((1.0-opacity)*255.0);
Rec.Reinit(TAG_FLATTRANSPARENTFILL, TAG_FLATTRANSPARENTFILL_SIZE);
ok = Rec.WriteBYTE(bOpacity);
ok = Rec.WriteBYTE(0x01);
ok = m_pExporter->WriteRecord(&Rec);
}
}
if (witch & STYLE_STROKE_COLOUR) {
if (style.IsStrokeColourDefined()) {
wxColour col = style.GetStrokeColour();
if (col.Ok()) {
UINT32 iRecNo = DefineColour(col);
Rec.Reinit(TAG_LINECOLOUR, TAG_LINECOLOUR_SIZE);
ok = Rec.WriteReference(iRecNo);
ok = m_pExporter->WriteRecord(&Rec);
#if SVGDEBUG
svgtrace(DBGTRACE_STYLES, "stroke colour %d,%d,%d\n", col.Red(), col.Green(), col.Blue());
#endif
} else {
m_pExporter->WriteZeroSizedRecord(TAG_LINECOLOUR_NONE);
#if SVGDEBUG
svgtrace(DBGTRACE_STYLES, "no stroke colour\n");
#endif
}
} else {
m_pExporter->WriteZeroSizedRecord(TAG_LINECOLOUR_NONE);
#if SVGDEBUG
svgtrace(DBGTRACE_STYLES, "no stroke colour\n");
#endif
}
}
if (witch & STYLE_STROKE_WIDTH && style.IsStrokeWidthDefined()) {
UINT32 iStrokeWidth = style.GetStrokeWidth();
Rec.Reinit(TAG_LINEWIDTH, TAG_LINEWIDTH_SIZE);
ok = Rec.WriteINT32(iStrokeWidth);
ok = m_pExporter->WriteRecord(&Rec);
}
//.........这里部分代码省略.........