本文整理汇总了C#中DashStyle类的典型用法代码示例。如果您正苦于以下问题:C# DashStyle类的具体用法?C# DashStyle怎么用?C# DashStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DashStyle类属于命名空间,在下文中一共展示了DashStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PenEx
/// <summary>
/// Initializes a new instance of the <see cref="PenEx"/> class with the <see cref="DashStyle"/>.
/// </summary>
/// <param name="color">The <see cref="Color"/> of the <see cref="PenEx"/>.</param>
/// <param name="style"></param>
public PenEx(Color color, DashStyle style)
{
this.color = color;
this.penStyle = style;
this.width = 1;
hPen = GDIPlus.CreatePen((int)style, width, ColorTranslator.ToWin32(color)/*GDIPlus.RGB(color)*/);
}
示例2: GetPen
public Pen GetPen(Color color, float width = 1, DashStyle style = DashStyle.Solid)
{
var desc = new PenDescriber(width, color, style);
Pen pen;
if (pens.TryGetValue(desc, out pen)) return pen;
pen = new Pen(color);
if (width != 1) pen.Width = width;
if (style != DashStyle.Solid)
{
pen.DashStyle = style;
switch (pen.DashStyle)
{
case DashStyle.Dot:
pen.DashPattern = defaultDotPattern;
break;
case DashStyle.Dash:
pen.DashPattern = defaultDashPattern;
break;
case DashStyle.DashDot:
pen.DashPattern = defaultDashDotPattern;
break;
default:
pen.DashPattern = defaultDashDotDotPattern;
break;
}
}
pens.Add(desc, pen);
return pen;
}
示例3: LineStyle
/// <summary>
/// Constructor for a style where lines will be displayed with the
/// specified line weight.
/// </summary>
/// <param name="col">The display colour</param>
/// <param name="wt">The line weight (in meters on the ground)</param>
/// <param name="dp">Any dashed line pattern that should be used (null
/// for a solid line</param>
internal LineStyle(Color col, double wt, DashPattern dp)
: base(col)
{
m_Weight = wt;
m_Pattern = dp;
m_Style = (m_Pattern==null ? DashStyle.Solid : DashStyle.Custom);
}
示例4: BaseCircleItem
public BaseCircleItem()
{
this.thickness = 1;
this.dashStyle = DashStyle.Solid;
this.Size = new Size(GlobalValues.PreferedSize.Width,2* GlobalValues.PreferedSize.Height);
TypeDescriptor.AddProvider(new RectangleItemTypeProvider(), typeof(BaseCircleItem));
}
示例5: GetLineStypefromString
public static DashStyle GetLineStypefromString(string LineStyleIn)
{
DashStyle DashStyleOut = new DashStyle();
switch (LineStyleIn)
{
case "Solid":
DashStyleOut = DashStyle.Solid;
break;
case "Dash":
DashStyleOut = DashStyle.Dash;
break;
case "DashDot":
DashStyleOut = DashStyle.DashDot;
break;
case "DashDotDot":
DashStyleOut = DashStyle.DashDotDot;
break;
case "Dot":
DashStyleOut = DashStyle.Dot;
break;
default:
DashStyleOut = DashStyle.Solid;
break;
}
return DashStyleOut;
}
示例6: ColorToolControl
public ColorToolControl(bool fillMode = false)
{
_selectedColor = Color.Black;
_selectedWidth = 2F;
_selectedDash = DashStyle.Solid;
InitializeComponent(fillMode);
}
示例7: BaseLineItem
public BaseLineItem()
{
this.thickness = 1;
this.dashStyle = DashStyle.Solid;
this.Size = new Size(50,10);
TypeDescriptor.AddProvider(new LineItemTypeProvider(), typeof(BaseLineItem));
this.SetStartEndPoint();
}
示例8: DrawSamplePen
// Methods
public static void DrawSamplePen(Graphics gr, Rectangle sample_bounds, Color line_color, DashStyle line_style)
{
int y = sample_bounds.Y + (sample_bounds.Height / 2);
using (Pen line_pen = new Pen(Color.Black, 2f))
{
line_pen.DashStyle = line_style;
gr.DrawLine(line_pen, sample_bounds.Left + 1, y, sample_bounds.Right - 1, y);
}
}
示例9: Function
public Function(StringBuilder name, Color color, DashStyle LineStyle, char Argument)
{
this.name = name;
RPNsequence = new string[name.Length];
this.color = color;
this.LineStyle = LineStyle;
this.Argument = Argument;
ConvertToRPN();
}
示例10: Create
public void Create(Color color, float width, DashStyle dashStyle)
{
Control = new PenData
{
Color = color,
Width = width,
DashStyle = dashStyle,
};
}
示例11: LogicLine
public LogicLine(PointF point1, PointF point2, Color color, DashStyle lineType)
{
this.Type = LogicObjectType.Line;
this.point1 = point1;
this.point2 = point2;
this.ForeColor = color;
this.lineType = lineType;
this.length = this.GetLength();
}
示例12: LinkLine
public LinkLine(Font font)
{
this.LineColor = Color.DarkGray;
LineStyle = System.Drawing.Drawing2D.DashStyle.Solid;
Font = font;
//StartText = "";
//EndText = "";
MiddleText = "";
this.Font = new Font(this.Font.FontFamily.Name, 7F);
}
示例13: SetLineStyle
public void SetLineStyle(DashStyle style)
{
for (int i = 0; i < this.lineStyleArr.Length; i++)
{
if(this.lineStyleArr[i] == style)
{
this.selected = i;
}
}
this.Invalidate();
}
示例14: DrawControlLine
public static void DrawControlLine(IGraphics g, Color c, DashStyle style, Coordinates loc1, Coordinates loc2, WorldTransform wt)
{
float pw = 1.25f / wt.Scale;
using (IPen p = g.CreatePen()) {
p.Color = c;
p.Width = pw;
p.DashStyle = style;
g.DrawLine(p, Utility.ToPointF(loc1), Utility.ToPointF(loc2));
}
}
示例15: Pen
public Pen (Brush brush, float width)
{
_brush = (Brush)brush.Clone();;
_width = width;
_dashStyle = DashStyle.Solid;
_startCap = LineCap.Flat;
_dashCap = DashCap.Flat;
_endCap = LineCap.Flat;
_alignment = PenAlignment.Center;
_lineJoin = LineJoin.Miter;
_miterLimit = 10f;
_transform = new Matrix();
}