本文整理汇总了C#中System.Windows.Media.StreamGeometryContext.SetClosedState方法的典型用法代码示例。如果您正苦于以下问题:C# StreamGeometryContext.SetClosedState方法的具体用法?C# StreamGeometryContext.SetClosedState怎么用?C# StreamGeometryContext.SetClosedState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.StreamGeometryContext
的用法示例。
在下文中一共展示了StreamGeometryContext.SetClosedState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseToGeometryContext
//.........这里部分代码省略.........
else
{
p = ReadPoint(cmd, ! AllowComma);
_secondLastPoint = ReadPoint(cmd, AllowComma);
}
_lastPoint = ReadPoint(cmd, AllowComma);
context.BezierTo(p, _secondLastPoint, _lastPoint, IsStroked, ! IsSmoothJoin);
last_cmd = 'C';
}
while (IsNumber(AllowComma));
break;
case 'q': case 'Q': // quadratic Bezier
case 't': case 'T': // smooth quadratic Bezier
EnsureFigure();
do
{
if ((cmd == 't') || (cmd == 'T'))
{
if (last_cmd == 'Q')
{
_secondLastPoint = Reflect();
}
else
{
_secondLastPoint = _lastPoint;
}
_lastPoint = ReadPoint(cmd, ! AllowComma);
}
else
{
_secondLastPoint = ReadPoint(cmd, ! AllowComma);
_lastPoint = ReadPoint(cmd, AllowComma);
}
context.QuadraticBezierTo(_secondLastPoint, _lastPoint, IsStroked, ! IsSmoothJoin);
last_cmd = 'Q';
}
while (IsNumber(AllowComma));
break;
case 'a': case 'A':
EnsureFigure();
do
{
// A 3,4 5, 0, 0, 6,7
double w = ReadNumber(! AllowComma);
double h = ReadNumber(AllowComma);
double rotation = ReadNumber(AllowComma);
bool large = ReadBool();
bool sweep = ReadBool();
_lastPoint = ReadPoint(cmd, AllowComma);
context.ArcTo(
_lastPoint,
new Size(w, h),
rotation,
large,
#if PBTCOMPILER
sweep,
#else
sweep ? SweepDirection.Clockwise : SweepDirection.Counterclockwise,
#endif
IsStroked,
! IsSmoothJoin
);
}
while (IsNumber(AllowComma));
last_cmd = 'A';
break;
case 'z':
case 'Z':
EnsureFigure();
context.SetClosedState(IsClosed);
_figureStarted = false;
last_cmd = 'Z';
_lastPoint = _lastStart; // Set reference point to be first point of current figure
break;
default:
ThrowBadToken();
break;
}
}
}