本文整理汇总了C#中IniFile.ReadColor方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.ReadColor方法的具体用法?C# IniFile.ReadColor怎么用?C# IniFile.ReadColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.ReadColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetLabelStyle
void SetLabelStyle(IniFile.Section section, IFigure figure)
{
figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);
var fontName = section["FontName"];
double? fontSize = section.TryReadDouble("FontSize");
bool fontUnderline = section.ReadBool("FontUnderline", false);
var foreColor = section.ReadColor("ForeColor");
var backColor = section.ReadColor("BackColor");
TextStyle style = new TextStyle()
{
FontFamily = new FontFamily(fontName),
Color = foreColor,
Underline = fontUnderline
};
if (fontSize.HasValue)
{
style.FontSize = fontSize.Value * 1.7;
}
figure.Style = drawing.StyleManager.FindExistingOrAddNew(style);
}
示例2: SetPointStyle
void SetPointStyle(IniFile.Section section, IFigure figure)
{
figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);
var fillColor = section.ReadColor("FillColor");
var fillStyle = section.ReadInt("FillStyle");
var foreColor = section.ReadColor("ForeColor");
var physicalWidth = section.ReadDouble("PhysicalWidth");
if (fillStyle == 1)
{
fillColor = Colors.Transparent;
}
PointStyle pointStyle = new PointStyle()
{
Fill = new SolidColorBrush(fillColor),
Color = foreColor,
Size = physicalWidth,
StrokeWidth = 0.7
};
figure.Style = drawing.StyleManager.FindExistingOrAddNew(pointStyle);
}
示例3: SetFigureStyle
void SetFigureStyle(IniFile.Section section, IFigure figure)
{
figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);
var fillColor = section.ReadColor("FillColor");
var foreColor = section.ReadColor("ForeColor");
double drawWidth = section.TryReadDouble("DrawWidth") ?? 1.0;
if (drawWidth < 0.1)
{
drawWidth = 0.1;
}
int? drawStyle = section.TryReadInt("DrawStyle");
int? fillStyle = section.TryReadInt("FillStyle");
int? drawMode = section.TryReadInt("DrawMode");
if (fillStyle == null || fillStyle == 6)
{
fillColor = Colors.Transparent;
}
DoubleCollection strokeDashArray = null;
if (drawStyle != null && drawStyle != 0)
{
strokeDashArray = new DoubleCollection();
switch (drawStyle)
{
case 1:
strokeDashArray.Add(15 / drawWidth, 6 / drawWidth);
break;
case 2:
strokeDashArray.Add(3 / drawWidth, 3 / drawWidth);
break;
case 3:
strokeDashArray.Add(10 / drawWidth, 4 / drawWidth, 2 / drawWidth, 4 / drawWidth);
break;
case 4:
strokeDashArray.Add(10 / drawWidth, 4 / drawWidth, 2 / drawWidth, 4 / drawWidth, 2 / drawWidth, 4 / drawWidth);
break;
default:
break;
}
}
IFigureStyle style;
if (figure is IShapeWithInterior)
{
if (fillColor != Colors.Transparent && drawMode != 13)
{
fillColor.A = 128;
}
style = new ShapeStyle()
{
Fill = new SolidColorBrush(fillColor),
Color = foreColor,
StrokeWidth = drawWidth,
StrokeDashArray = strokeDashArray
};
}
else
{
if (foreColor == Colors.Transparent)
{
System.Diagnostics.Debugger.Break();
}
style = new LineStyle()
{
Color = foreColor,
StrokeWidth = drawWidth,
StrokeDashArray = strokeDashArray
};
}
figure.Style = drawing.StyleManager.FindExistingOrAddNew(style);
}