本文整理汇总了C#中LineStyle类的典型用法代码示例。如果您正苦于以下问题:C# LineStyle类的具体用法?C# LineStyle怎么用?C# LineStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineStyle类属于命名空间,在下文中一共展示了LineStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getContourPen
private Pen getContourPen(LineStyle style)
{
var result = new Pen(style.Color);
result.Width = style.Width;
result.DashStyle = style.DashStyle;
return result;
}
示例2: BorderProperties
public BorderProperties(double? width = null, LineStyle style = null, string color = null)
{
Metric = MarkupMetric.Pixels;
Width = width;
Style = style;
Color = color;
}
示例3: SingleLine
/// <summary>
/// Creates a new instance of the class.
/// </summary>
/// <param name="orientation">The orientation of the line.</param>
/// <param name="lineStyle">The style of the line.</param>
public SingleLine(Orientation orientation, LineStyle lineStyle)
{
this.Controls.Add(_ForeLine);
this.BackColor = SystemColors.ButtonShadow;
this.ForeColor = SystemColors.ButtonHighlight;
this.TabStop = false;
this.Disposed += new EventHandler(OnComponentDisposed);
this.Resize += new EventHandler(OnComponentResize);
this.ForeColorChanged += new EventHandler(OnComponentColorChanged);
this.BackColorChanged += new EventHandler(OnComponentColorChanged);
_Orientation = orientation;
_LineStyle = lineStyle;
_ForeLine.BorderStyle = BorderStyle.None;
_ForeLine.Enabled = false;
RefreshLine();
OnComponentColorChanged(this, null);
try
{
SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(OnVisualStyleChanged);
}
catch
{ }
}
示例4: CurveInfo
public CurveInfo(Func<double, double> function, LineStyle style, string caption, bool invertFunc = false)
{
Function = function;
Style = style;
Caption = caption;
InvertFunc = invertFunc;
}
示例5: Style
internal Style(Workbook wb, XfRecord xf) : base(wb)
{
if(xf.FontIdx > 0 && xf.FontIdx < wb.Fonts.Count)
_font = wb.Fonts[xf.FontIdx - 1];
_format = wb.Formats[xf.FormatIdx];
_typeAndProtection = xf.TypeAndProtection;
if(_typeAndProtection.IsCell)
_parentStyle = wb.Styles[xf.ParentIdx];
_horizontalAlignment = xf.HorizontalAlignment;
_wrapped = xf.Wrapped;
_verticalAlignment = xf.VerticalAlignment;
_rotation = xf.Rotation;
_indentLevel = xf.IndentLevel;
_shrinkContent = xf.ShrinkContent;
_parentStyleAttributes = xf.ParentStyle;
_leftLineStyle = xf.LeftLineStyle;
_rightLineStyle = xf.RightLineStyle;
_topLineStyle = xf.TopLineStyle;
_bottomLineStyle = xf.BottomLineStyle;
_leftLineColor = wb.Palette.GetColor(xf.LeftLineColor);
_rightLineColor = wb.Palette.GetColor(xf.RightLineColor);
_diagonalRightTopToLeftBottom = xf.DiagonalRightTopToLeftBottom;
_diagonalLeftBottomToTopRight = xf.DiagonalLeftBottomToTopRight;
_topLineColor = wb.Palette.GetColor(xf.TopLineColor);
_bottomLineColor = wb.Palette.GetColor(xf.BottomLineColor);
_diagonalLineColor = wb.Palette.GetColor(xf.DiagonalLineColor);
_diagonalLineStyle = xf.DiagonalLineStyle;
_fillPattern = xf.FillPattern;
_patternColor = wb.Palette.GetColor(xf.PatternColor);
_patternBackground = wb.Palette.GetColor(xf.PatternBackground);
}
示例6: LineStyleArray
public LineStyleArray()
{
Styles = new LineStyle[]
{
new LineStyle()
};
}
示例7: OverlayShape
protected OverlayShape(Color color, float width, LineStyle lineStyle)
{
Color = color;
Width = width;
LineStyle = lineStyle;
_geos = new List<Geo>();
}
示例8: GetDashArray
/// <summary>
/// Gets the stroke dash array for a given <see cref="LineStyle"/>.
/// </summary>
/// <param name="style">
/// The line style.
/// </param>
/// <returns>
/// A dash array.
/// </returns>
public static double[] GetDashArray(LineStyle style)
{
switch (style)
{
case LineStyle.Solid:
return null;
case LineStyle.Dash:
return new double[] { 4, 1 };
case LineStyle.Dot:
return new double[] { 1, 1 };
case LineStyle.DashDot:
return new double[] { 4, 1, 1, 1 };
case LineStyle.DashDashDot:
return new double[] { 4, 1, 4, 1, 1, 1 };
case LineStyle.DashDotDot:
return new double[] { 4, 1, 1, 1, 1, 1 };
case LineStyle.DashDashDotDot:
return new double[] { 4, 1, 4, 1, 1, 1, 1, 1 };
case LineStyle.LongDash:
return new double[] { 10, 1 };
case LineStyle.LongDashDot:
return new double[] { 10, 1, 1, 1 };
case LineStyle.LongDashDotDot:
return new double[] { 10, 1, 1, 1, 1, 1 };
default:
return null;
}
}
示例9: Line
public Line(Point start, Point stop, LineType type, LineStyle style)
{
Start = start;
Stop = stop;
Type = type;
Style = style;
}
示例10: CombineStyles
LineStyle CombineStyles(LineStyle one, LineStyle two)
{
if (one == LineStyle.Add || two == LineStyle.Add)
return LineStyle.Add;
if (one == LineStyle.Delete || two == LineStyle.Delete)
return LineStyle.Delete;
return LineStyle.Unchanged;
}
示例11: OverlayLineSegment
public OverlayLineSegment(Geo p1, Geo p2, Color color, float width, LineStyle lineStyle)
: base(color, width, lineStyle)
{
Add(p1);
Add(p2);
Course = new Course(p1, p2);
ComputeCoefficients();
}
示例12: CustomStartEndLineStyle
public CustomStartEndLineStyle(string startFontName, int startCharacterIndex, Color startColor, float startSize,
string endFontName, int endCharacterIndex, Color endColor, float endSize,
Color lineColor, float lineSize)
{
var startFont = new GeoFont(startFontName, startSize);
var endFont = new GeoFont(endFontName, endSize);
_startPointStyle = new PointStyle(startFont, startCharacterIndex, new GeoSolidBrush(GeoColor.FromArgb(startColor.A, startColor.R, startColor.G, startColor.B)));
_endPointStyle = new PointStyle(endFont, endCharacterIndex, new GeoSolidBrush(GeoColor.FromArgb(endColor.A, endColor.R, endColor.G, endColor.B)));
_lineStyle = new LineStyle(new GeoPen(GeoColor.FromArgb(lineColor.A, lineColor.R, lineColor.G, lineColor.B), lineSize));
}
示例13: ConfigureOGLLineProperties
protected void ConfigureOGLLineProperties(LineStyle style, int width) {
int stipFact = 0;
short stipple = ILPanel.StippleFromLineStyle(style,ref stipFact);
GL.LineWidth(width);
if (style == LineStyle.Solid || style == LineStyle.None) {
GL.Disable(EnableCap.LineStipple);
} else {
GL.Enable(EnableCap.LineStipple);
GL.LineStipple (stipFact,stipple);
}
}
示例14: IsValid
/// <summary>
/// Determines if the given value represents a valid state of this property.
/// </summary>
/// <param name="value">The state that should be used.</param>
/// <returns>True if the state is valid, otherwise false.</returns>
protected override Boolean IsValid(CSSValue value)
{
var style = value.ToLineStyle();
if (style.HasValue)
_style = style.Value;
else if (value != CSSValue.Inherit)
return false;
return true;
}
示例15: OverlayLineSegments
public OverlayLineSegments(ICollection<Geo> points, Color color, float size = 1f, LineStyle lineStyle = LineStyle.Solid)
: base(color, size, lineStyle)
{
Segments = new List<OverlayLineSegment>();
Add(points);
if (points.Count < 2) return;
CreateSegments();
ComputeBoundingBox();
CheckForClosure();
CheckCrossingSegments();
}