本文整理匯總了C#中OxyPlot.OxyColor.ToColor方法的典型用法代碼示例。如果您正苦於以下問題:C# OxyColor.ToColor方法的具體用法?C# OxyColor.ToColor怎麽用?C# OxyColor.ToColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OxyPlot.OxyColor
的用法示例。
在下文中一共展示了OxyColor.ToColor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreatePen
/// <summary>
/// Gets a cached pen.
/// </summary>
/// <param name="stroke">The stroke.</param>
/// <param name="thickness">The thickness.</param>
/// <param name="dashArray">The dash array.</param>
/// <param name="lineJoin">The line join.</param>
/// <returns>A <see cref="Pen" />.</returns>
private Pen CreatePen(OxyColor stroke, double thickness, double[] dashArray = null, OxyPlot.LineJoin lineJoin = OxyPlot.LineJoin.Miter)
{
var pen = new Pen(stroke.ToColor(), (float)thickness);
if (dashArray != null)
{
pen.DashPattern = this.ToFloatArray(dashArray);
}
switch (lineJoin)
{
case OxyPlot.LineJoin.Round:
pen.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
break;
case OxyPlot.LineJoin.Bevel:
pen.LineJoin = System.Drawing.Drawing2D.LineJoin.Bevel;
break;
//// The default LineJoin is Miter
}
return pen;
}