本文整理汇总了C++中Style::IsStrokeOpacityDefined方法的典型用法代码示例。如果您正苦于以下问题:C++ Style::IsStrokeOpacityDefined方法的具体用法?C++ Style::IsStrokeOpacityDefined怎么用?C++ Style::IsStrokeOpacityDefined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Style
的用法示例。
在下文中一共展示了Style::IsStrokeOpacityDefined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OutputStyles
//.........这里部分代码省略.........
if (witch & STYLE_STROKE_LINEJOIN )
{
JointType jt;
if (style.IsStrokeLineJoinDefined()) {
jt=style.GetStrokeLineJoin();
#if SVGDEBUG
switch(jt)
{
case MitreJoin:
svgtrace(DBGTRACE_STYLES, "stroke join mitre\n");
break;
case BevelledJoin:
svgtrace(DBGTRACE_STYLES, "stroke join bevel\n");
break;
case RoundJoin:
svgtrace(DBGTRACE_STYLES, "stroke join round\n");
break;
}
#endif
} else {
jt=MitreJoin;
#if SVGDEBUG
svgtrace(DBGTRACE_STYLES, "no stroke specified, using mitre\n");
#endif
}
Rec.Reinit(TAG_JOINSTYLE, TAG_JOINSTYLE_SIZE);
ok = Rec.WriteBYTE(BYTE(jt));
ok = m_pExporter->WriteRecord(&Rec);
}
if (witch & STYLE_STROKE_LINECAP && style.IsStrokeLineCapDefined()) {
LineCapType lct=style.GetStrokeLineCap();
Rec.Reinit(TAG_STARTCAP, TAG_STARTCAP_SIZE);
ok = Rec.WriteBYTE(BYTE(lct));
ok = m_pExporter->WriteRecord(&Rec);
Rec.Reinit(TAG_ENDCAP, TAG_ENDCAP_SIZE);
ok = Rec.WriteBYTE(BYTE(lct));
ok = m_pExporter->WriteRecord(&Rec);
#if SVGDEBUG
switch(lct)
{
case LineCapButt:
svgtrace(DBGTRACE_STYLES, "stroke cap butt\n");
break;
case LineCapRound:
svgtrace(DBGTRACE_STYLES, "stroke cap round\n");
break;
case LineCapSquare:
svgtrace(DBGTRACE_STYLES, "stroke cap square\n");
break;
}
#endif
}
if (witch & STYLE_STROKE_OPACITY && style.IsStrokeOpacityDefined()) {
double opacity = style.GetStrokeOpacity();
if (opacity < 1.0) {
BYTE bOpacity = (BYTE)((1.0-opacity)*255.0);
Rec.Reinit(TAG_LINETRANSPARENCY, TAG_LINETRANSPARENCY_SIZE);
ok = Rec.WriteBYTE(bOpacity);
ok = Rec.WriteBYTE(0x01); // mix
ok = m_pExporter->WriteRecord(&Rec);
}
}
if (witch & STYLE_OPACITY && style.IsOpacityDefined()) {
double fOpacity = style.GetOpacity();
if (fOpacity < 1.0) {
double fFillOpacity = fOpacity;
double fStrokeOpacity = fOpacity;
if (style.IsFillOpacityDefined())
fFillOpacity *= style.GetFillOpacity();
if (style.IsStrokeOpacityDefined())
fStrokeOpacity *= style.GetStrokeOpacity();
BYTE bFillOpacity = (BYTE)((1.0-fFillOpacity)*255.0);
BYTE bStrokeOpacity = (BYTE)((1.0-fStrokeOpacity)*255.0);
Rec.Reinit(TAG_FLATTRANSPARENTFILL, TAG_FLATTRANSPARENTFILL_SIZE);
ok = Rec.WriteBYTE(bFillOpacity);
ok = Rec.WriteBYTE(0x01); // mix
ok = m_pExporter->WriteRecord(&Rec);
Rec.Reinit(TAG_LINETRANSPARENCY, TAG_LINETRANSPARENCY_SIZE);
ok = Rec.WriteBYTE(bStrokeOpacity);
ok = Rec.WriteBYTE(0x01); // mix
ok = m_pExporter->WriteRecord(&Rec);
}
}
return ok;
}