本文整理汇总了C#中Pen.ToSD方法的典型用法代码示例。如果您正苦于以下问题:C# Pen.ToSD方法的具体用法?C# Pen.ToSD怎么用?C# Pen.ToSD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pen
的用法示例。
在下文中一共展示了Pen.ToSD方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetLineCap
public void SetLineCap (Pen widget, PenLineCap lineCap)
{
var pen = widget.ToSD ();
pen.StartCap = pen.EndCap = lineCap.ToSD ();
pen.DashCap = lineCap == PenLineCap.Round ? sd2.DashCap.Round : sd2.DashCap.Flat;
SetDashStyle (widget, widget.DashStyle);
}
示例2: SetLineCap
public void SetLineCap (Pen widget, PenLineCap lineCap)
{
var pen = widget.ToSD ();
// get dash style before changing cap
var dashStyle = widget.DashStyle;
pen.StartCap = pen.EndCap = lineCap.ToSD ();
pen.DashCap = lineCap == PenLineCap.Round ? sd2.DashCap.Round : sd2.DashCap.Flat;
SetDashStyle (widget, dashStyle);
}
示例3: GetDashStyle
public DashStyle GetDashStyle (Pen widget)
{
var pen = widget.ToSD ();
if (pen.DashStyle == sd2.DashStyle.Solid)
return DashStyles.Solid;
else {
var offset = pen.StartCap == sd2.LineCap.Square ? pen.DashOffset - 0.5f : pen.DashOffset;
return new DashStyle (offset, pen.DashPattern);
}
}
示例4: SetDashStyle
public void SetDashStyle (Pen widget, DashStyle dashStyle)
{
var pen = widget.ToSD ();
pen.DashOffset = 0;
if (dashStyle == null || dashStyle.IsSolid)
pen.DashStyle = sd2.DashStyle.Solid;
else if (dashStyle.Equals(DashStyles.Dash))
pen.DashStyle = sd2.DashStyle.Dash;
else if (dashStyle.Equals(DashStyles.DashDot))
pen.DashStyle = sd2.DashStyle.DashDot;
else if (dashStyle.Equals(DashStyles.DashDotDot))
pen.DashStyle = sd2.DashStyle.DashDotDot;
else
{
pen.DashStyle = sd2.DashStyle.Custom;
pen.DashPattern = dashStyle.Dashes;
pen.DashOffset = dashStyle.Offset;
}
if (pen.StartCap == sd2.LineCap.Square)
{
pen.DashOffset += 0.5f;
}
}
示例5: SetMiterLimit
public void SetMiterLimit (Pen widget, float miterLimit)
{
widget.ToSD ().MiterLimit = miterLimit;
}
示例6: GetMiterLimit
public float GetMiterLimit (Pen widget)
{
return widget.ToSD ().MiterLimit;
}
示例7: GetLineCap
public PenLineCap GetLineCap (Pen widget)
{
return widget.ToSD ().StartCap.ToEto ();
}
示例8: SetLineJoin
public void SetLineJoin (Pen widget, PenLineJoin lineJoin)
{
widget.ToSD ().LineJoin = lineJoin.ToSD ();
}
示例9: GetLineJoin
public PenLineJoin GetLineJoin (Pen widget)
{
return widget.ToSD ().LineJoin.ToEto ();
}
示例10: SetThickness
public void SetThickness (Pen widget, float thickness)
{
widget.ToSD ().Width = thickness;
}
示例11: GetThickness
public float GetThickness (Pen widget)
{
return widget.ToSD ().Width;
}
示例12: SetColor
public void SetColor (Pen widget, Color color)
{
widget.ToSD ().Color = color.ToSD ();
}
示例13: GetColor
public Color GetColor (Pen widget)
{
return widget.ToSD ().Color.ToEto ();
}