当前位置: 首页>>代码示例>>C#>>正文


C# DashStyle类代码示例

本文整理汇总了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)*/);
		}
开发者ID:JeffreyZksun,项目名称:gpstranslator,代码行数:12,代码来源:PenEx.cs

示例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;
 }
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:29,代码来源:PenStorage.cs

示例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);
 }
开发者ID:steve-stanton,项目名称:backsight,代码行数:15,代码来源:LineStyle.cs

示例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));
		}
开发者ID:ootsby,项目名称:SharpDevelop,代码行数:7,代码来源:BaseCircleItem.cs

示例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;
        }
开发者ID:akapetanovic,项目名称:ASTERIX-ANALYSER-and-DATA-DISPLAY,代码行数:27,代码来源:DisplayAttributes.cs

示例6: ColorToolControl

        public ColorToolControl(bool fillMode = false)
        {
            _selectedColor = Color.Black;
            _selectedWidth = 2F;
            _selectedDash = DashStyle.Solid;

            InitializeComponent(fillMode);
        }
开发者ID:panoti,项目名称:DADHMT_LTW,代码行数:8,代码来源:ColorToolControl.cs

示例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();
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:8,代码来源:BaseLine.cs

示例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);
     }
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:10,代码来源:LineStyleEditorStuff.cs

示例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();
 }
开发者ID:MathMark,项目名称:SmartBuilder,代码行数:9,代码来源:Function.cs

示例10: Create

 public void Create(Color color, float width, DashStyle dashStyle)
 {
     Control = new PenData
     {
         Color = color,
         Width = width,
         DashStyle = dashStyle,
     };
 }
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:9,代码来源:PenHandler.cs

示例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();
        }
开发者ID:BGCX261,项目名称:ziliao-svn-to-git,代码行数:10,代码来源:LogicLine.cs

示例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);
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:10,代码来源:LinkLine.cs

示例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();
 }
开发者ID:Dr1N,项目名称:PaintNET,代码行数:11,代码来源:LineStyleChoicer.cs

示例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));
            }
        }
开发者ID:anand-ajmera,项目名称:cornell-urban-challenge,代码行数:12,代码来源:DrawingUtility.cs

示例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();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:13,代码来源:Pen.jvm.cs


注:本文中的DashStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。