Exemple #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public LineStyleDialog(int lineWidth, System.Drawing.Drawing2D.DashStyle style)
        {
            InitializeComponent();

            switch (style)
            {
                case System.Drawing.Drawing2D.DashStyle.Solid:
                    solidRadioButton.Checked = true;
                    break;
                case System.Drawing.Drawing2D.DashStyle.Dash:
                    dashRadioButton.Checked = true;
                    break;
                case System.Drawing.Drawing2D.DashStyle.DashDot:
                    dashDotRadioButton.Checked = true;
                    break;
                case System.Drawing.Drawing2D.DashStyle.Dot:
                    dotRadioButton.Checked = true;
                    break;
                case System.Drawing.Drawing2D.DashStyle.DashDotDot:
                    dashDotDotRadioButton.Checked = true;
                    break;
            }
            m_style = style;
            m_width = lineWidth;
            lineTextBox.Text = m_width.ToString();
        }
 public BorderLine(Color p_Color, float p_Width, System.Drawing.Drawing2D.DashStyle dashStyle, float padding)
 {
     Width     = p_Width;
     Color     = p_Color;
     DashStyle = dashStyle;
     Padding   = padding;
 }
Exemple #3
0
        private void cbKieuVe_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (cbKieuVe.SelectedIndex)
            {
            case 0:
                dashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
                break;

            case 1:
                dashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
                break;

            case 2:
                dashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
                break;

            case 3:
                dashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                break;

            case 4:
                dashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                break;

            case 5:
                dashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
                break;
            }
        }
Exemple #4
0
        private void Draw(System.Drawing.Drawing2D.DashStyle DashStyle, Graphics g)
        {
            Pen p = new Pen(Color.Black, 2);

            p.DashStyle = DashStyle;
            g.DrawLine(p, 0, DotPictureBox.Height / 2, DotPictureBox.Width, DotPictureBox.Height / 2);
        }
Exemple #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            // this.ReturnValue1 = "Something";
            //  this.ReturnValue2 = DateTime.Now.ToString(); //example


            switch ((string)this.domainUpDown1.SelectedItem)
            {
            case "Dash":
                this.lineStyle = System.Drawing.Drawing2D.DashStyle.Dash;
                break;

            case "DashDot":
                this.lineStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
                break;

            case "DashDotDot":
                this.lineStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                break;

            case "Dot":
                this.lineStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                break;

            case "Solid":
                this.lineStyle = System.Drawing.Drawing2D.DashStyle.Solid;
                break;
            }

            this.lineWidth = (float)this.numericUpDown1.Value;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemple #6
0
        private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            var cb = (ComboBox)sender;

            dashStyle = (System.Drawing.Drawing2D.DashStyle)cb.SelectedIndex;
            pictureBox1.Invalidate();
        }
Exemple #7
0
 public PlotableFunction(Func <double, double> F, string FuncName, System.Drawing.Drawing2D.DashStyle dashstyle, int linewidth)
 {
     this.Name      = FuncName;
     this.F         = F;
     this.DashStyle = dashstyle;
     this.LineWidth = linewidth;
 }
Exemple #8
0
        public Line AddLineSeries(TChart objChart, string p_SeriesName, VerticalAxis p_VertAxis,
                                  Color p_seriesColor, bool p_IsDateTime, bool p_showInLegend, bool pointVisible,
                                  System.Drawing.Drawing2D.DashStyle p_lineStyle, int p_lineWidth)
        {
            Steema.TeeChart.Styles.Line lineSeries = new Steema.TeeChart.Styles.Line();
            objChart.Series.Add(lineSeries);

            lineSeries.VertAxis         = p_VertAxis;
            lineSeries.XValues.DateTime = p_IsDateTime;
            lineSeries.Title            = p_SeriesName;
            lineSeries.Marks.Visible    = false;
            lineSeries.ShowInLegend     = p_showInLegend;
            lineSeries.Color            = p_seriesColor;

            // Line-Point Display
            lineSeries.Pointer.Visible     = pointVisible;
            lineSeries.Pointer.Style       = PointerStyles.Circle;
            lineSeries.Pointer.Pen.Visible = false;
            lineSeries.Pointer.HorizSize   = 3;
            lineSeries.Pointer.VertSize    = 3;

            lineSeries.LinePen.Style = p_lineStyle;
            lineSeries.LinePen.Width = p_lineWidth;

            return(lineSeries);
        }
Exemple #9
0
        private void m_cbEstilo_TextChanged(object sender, System.EventArgs e)
        {
            Object obj = m_cbEstilo.ReturnObjectSelectedItem();

            if (obj != null)
            {
                switch (Int32.Parse(obj.ToString()))
                {
                case ESTILO_SOLIDO:
                    m_styEstilo = System.Drawing.Drawing2D.DashStyle.Solid;
                    break;

                case ESTILO_PONTO:
                    m_styEstilo = System.Drawing.Drawing2D.DashStyle.Dot;
                    break;

                case ESTILO_TRAÇO:
                    m_styEstilo = System.Drawing.Drawing2D.DashStyle.Dash;
                    break;

                case ESTILO_TRAÇO_PONTO:
                    m_styEstilo = System.Drawing.Drawing2D.DashStyle.DashDot;
                    break;

                case ESTILO_TRAÇO_PONTO_PONTO:
                    m_styEstilo = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                    break;
                }
                RefreshExemplo();
            }
        }
 public void WriteBorderLineDashStyle(System.Drawing.Drawing2D.DashStyle style)
 {
     if (bolCollectionInfo == false)
     {
         if (style == System.Drawing.Drawing2D.DashStyle.Dot)
         {
             this.WriteKeyword("brdrdot");
         }
         else if (style == System.Drawing.Drawing2D.DashStyle.DashDot)
         {
             this.WriteKeyword("brdrdashd");
         }
         else if (style == System.Drawing.Drawing2D.DashStyle.DashDotDot)
         {
             this.WriteKeyword("brdrdashdd");
         }
         else if (style == System.Drawing.Drawing2D.DashStyle.Dash)
         {
             this.WriteKeyword("brdrdash");
         }
         else
         {
             this.WriteKeyword("brdrs");
         }
     }
 }
Exemple #11
0
        public RGPen GetPen(SolidColor color, RGFloat weight, RGDashStyle style)
        {
            if (color.A == 0)
            {
                return(null);
            }

            RGPen        pen;
            List <RGPen> penlist;

            lock (cachedPens)
            {
                if (!cachedPens.TryGetValue(color, out penlist))
                {
                    penlist = cachedPens[color] = new List <RGPen>();
#if WINFORM
                    penlist.Add(pen = new RGPen(color, weight));
#elif WPF
                    penlist.Add(pen = new RGPen(new RGSolidBrush(color), weight));
#endif // WPF

                    pen.DashStyle = style;

                    if ((cachedPens.Count % 10) == 0)
                    {
                        Logger.Log("resource pool", "wf pen count: " + cachedPens.Count);
                    }
                }
                else
                {
                    lock (penlist)
                    {
#if WINFORM
                        pen = penlist.FirstOrDefault(p => p.Width == weight && p.DashStyle == style);
#elif WPF
                        pen = penlist.FirstOrDefault(p => p.Thickness == weight && p.DashStyle == style);
#endif // WPF
                    }

                    if (pen == null)
                    {
#if WINFORM
                        penlist.Add(pen = new RGPen(color, weight));
#elif WPF
                        penlist.Add(pen = new RGPen(new RGSolidBrush(color), weight));
#endif // WPF
                        pen.DashStyle = style;

                        if ((cachedPens.Count % 10) == 0)
                        {
                            Logger.Log("resource pool", "pen count: " + cachedPens.Count);
                        }
                    }
                }
            }

            return(pen);
        }
Exemple #12
0
        /// <summary>
        /// Change the dashStyle of the current struct instance and return a copy of the modified struct.
        /// </summary>
        /// <param name="dashStyle"></param>
        /// <returns></returns>
        public RectangleBorder SetDashStyle(System.Drawing.Drawing2D.DashStyle dashStyle)
        {
            Top    = new BorderLine(Top.Color, Top.Width, dashStyle, Top.Padding);
            Bottom = new BorderLine(Bottom.Color, Bottom.Width, dashStyle, Bottom.Padding);
            Left   = new BorderLine(Left.Color, Left.Width, dashStyle, Left.Padding);
            Right  = new BorderLine(Right.Color, Right.Width, dashStyle, Right.Padding);

            return(this);
        }
Exemple #13
0
 public frmFRelatoriosCaneta(ref mdlTratamentoErro.clsTratamentoErro tratadorErro, string enderecoExecutavel, int espessura, System.Drawing.Drawing2D.DashStyle estilo, System.Drawing.Color corCaneta)
 {
     m_cls_ter_tratadorErro  = tratadorErro;
     m_strEnderecoExecutavel = enderecoExecutavel;
     m_nEspessura            = espessura;
     m_styEstilo             = estilo;
     m_corCaneta             = corCaneta;
     InitializeComponent();
 }
Exemple #14
0
 /// <summary>
 /// Copies from another PlotItem with a deep copy.
 /// </summary>
 public virtual void CopyFrom(PlotItem item)
 {
     model     = item.model;
     name      = (string)item.name.Clone();
     color     = item.color;
     lineStyle = item.lineStyle;
     lineWidth = item.lineWidth;
     recalc    = item.recalc;
     code      = item.code;
     errors    = (string[])errors.Clone();
 }
Exemple #15
0
        public void drawScreenRect(Graphics g, Rectangle rect, Color color, System.Drawing.Drawing2D.DashStyle style)
        {
            #region ***** 绘制body *****

            pen.DashStyle = style;
            pen.Color     = color;
            g.DrawRectangle(pen, rect);
            g.FillRectangle(Brushes.Aqua, rect.X, rect.Y, 20, 20);
            g.DrawString(m_iIndex.ToString("00"), font, Brushes.Blue, rect.X, rect.Y);

            #endregion
        }
Exemple #16
0
        public ColorLine AddColorLine(TChart objChart, Axis axis, Color lineColor, System.Drawing.Drawing2D.DashStyle dashStyle)
        {
            ColorLine colorLine = new ColorLine();

            objChart.Tools.Add(colorLine);

            colorLine.Axis      = axis;
            colorLine.Pen.Color = lineColor;
            colorLine.Pen.Style = dashStyle;

            return(colorLine);
        }
Exemple #17
0
 private void cmdOK_Click(object sender, EventArgs e)
 {
     if (cboScale.SelectedIndex > -1)
     {
         color        = pictureBoxColor.BackColor;
         scale        = double.Parse(cboScale.Items[cboScale.SelectedIndex].ToString());
         plotStyle    = (LinePlotStyle)cboPlotStyle.SelectedIndex;
         dashStyle    = (System.Drawing.Drawing2D.DashStyle)cboDashStyle.SelectedIndex;
         DialogResult = DialogResult.OK;
         Close();
     }
 }
Exemple #18
0
 public Shape(Color color, int thickness, PenStyle penStyle, int x1, int y1, int x2, int y2)
 {
     penThickness  = thickness;
     penColor      = color;
     this.penStyle = penStyle;
     pen           = new Pen(penColor, penThickness);
     pen.DashStyle = dashStyle = penStyle.Style;
     this.x1       = x1;
     this.x2       = x2;
     this.y1       = y1;
     this.y2       = y2;
 }
Exemple #19
0
        public System.Drawing.Pen Pen(string name, float width, System.Drawing.Drawing2D.DashStyle dash)
        {
            string fullname = name + "@" + width.ToString() + dash.ToString();

            if (_pens.ContainsKey(fullname))
            {
                return(_pens[fullname]);
            }
            System.Drawing.Pen pen = new System.Drawing.Pen(Brush(name), width);
            pen.DashStyle = dash;
            _pens.Add(fullname, pen);
            return(pen);
        }
Exemple #20
0
        public void DrawPianoMouseAxis(Color LineColor, float LineWidth, System.Drawing.Drawing2D.DashStyle LineStyle)
        {
            D2DGraphics g = baseEvent.D2DGraphics;
            //横线
            Point L1_p1 = new Point(baseEvent.ClipRectangle.Left, baseEvent.MousePoint.Y);
            Point L1_p2 = new Point(baseEvent.ClipRectangle.Left + baseEvent.ClipRectangle.Width, baseEvent.MousePoint.Y);
            //竖线
            Point L2_p1 = new Point(baseEvent.MousePoint.X, baseEvent.ClipRectangle.Top);
            Point L2_p2 = new Point(baseEvent.MousePoint.X, baseEvent.ClipRectangle.Top + baseEvent.ClipRectangle.Height);

            g.DrawLine(L1_p1, L1_p2, LineColor, LineWidth, LineStyle);
            g.DrawLine(L2_p1, L2_p2, LineColor, LineWidth, LineStyle);
        }
Exemple #21
0
 public StyledComboBox()
 {
     //if (!DesignMode)
     LP.Validate();
     borderDrawer          = new Oranikle.Studio.Controls.BorderDrawer();
     FlatStyle             = System.Windows.Forms.FlatStyle.Flat;
     DrawMode              = System.Windows.Forms.DrawMode.OwnerDrawVariable;
     _separatorStyle       = System.Drawing.Drawing2D.DashStyle.Solid;
     _separatorColor       = System.Drawing.Color.FromArgb(90, 90, 90);
     _separatorMargin      = 1;
     _separatorWidth       = 1;
     _autoAdjustItemHeight = false;
     borderDrawer.RegisterFocusHoverControl(this);
 }
Exemple #22
0
        public void drawLineDotHorizontal(int x1, int y1, int x2, int y2)
        {
            System.Drawing.Drawing2D.DashStyle old = mPen.DashStyle;
            mPen.DashStyle   = System.Drawing.Drawing2D.DashStyle.Dot;
            mPen.DashPattern = new float[] { 5, 5 };

            System.Drawing.Drawing2D.SmoothingMode oldSmoothMode = mGraphics.SmoothingMode;
            mGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            mGraphics.DrawLine(mPen, x1, y1, x2, y2);

            //  restore old state
            mPen.DashStyle          = old;
            mGraphics.SmoothingMode = oldSmoothMode;
        }
 public Function(Func <double, double> funcBody,
                 Color color,
                 string name,
                 System.Drawing.Drawing2D.DashStyle style,
                 double leftBorder  = double.MinValue,
                 double rightBorder = double.MaxValue
                 )
 {
     FuncBody    = funcBody;
     Color       = color;
     LeftBorder  = leftBorder;
     RightBorder = rightBorder;
     Name        = name;
     Style       = style;
 }
Exemple #24
0
        protected string GetDashStyle(System.Drawing.Drawing2D.DashStyle style)
        {
            switch (style)
            {
            case System.Drawing.Drawing2D.DashStyle.Solid:      return("<a:prstDash val=\"solid\"/>");

            case System.Drawing.Drawing2D.DashStyle.Dot:        return("<a:prstDash val=\"dot\"/>");

            case System.Drawing.Drawing2D.DashStyle.Dash:       return("<a:prstDash val=\"dash\"/>");

            case System.Drawing.Drawing2D.DashStyle.DashDot:    return("<a:prstDash val=\"dashDot\"/>");

            case System.Drawing.Drawing2D.DashStyle.DashDotDot: return("<a:prstDash val=\"sysDashDotDot\"/>");
            }
            throw new Exception("Unsupported dash style");
        }
        public void DrawYLine(double Percent, Color LineColor, float LineWidth = 1, System.Drawing.Drawing2D.DashStyle LineStyle = System.Drawing.Drawing2D.DashStyle.Solid)
        {
            if (Percent > 1)
            {
                Percent = 1;
            }
            if (Percent < 0)
            {
                Percent = 0;
            }
            D2DGraphics g      = baseEvent.D2DGraphics;
            double      rp     = 1 - Percent;
            int         PixelY = (int)(baseEvent.ClipRectangle.Height * rp);

            g.DrawLine(new Point(rconf.Const_RollWidth, PixelY), new Point(rconf.Const_RollWidth + baseEvent.ClipRectangle.Width, PixelY), LineColor, LineWidth, LineStyle);
        }
Exemple #26
0
 public FunctionByPoints(
     Color color,
     string name,
     System.Drawing.Drawing2D.DashStyle style,
     PointPairList points = null,
     double leftBorder    = double.MinValue,
     double rightBorder   = double.MaxValue
     )
 {
     Color       = color;
     LeftBorder  = leftBorder;
     RightBorder = rightBorder;
     Name        = name;
     Style       = style;
     Points      = points;
 }
Exemple #27
0
        public Shape AddShapeSeries(TChart Chart, bool Active, System.Drawing.Drawing2D.DashStyle PenStyle, ShapeStyles ShapeStyle, Color SeriesColor, Color PenColor, int Transparency)
        {
            Shape shapeSeries = new Shape();

            Chart.Series.Add(shapeSeries);
            shapeSeries.Active             = Active;
            shapeSeries.ShowInLegend       = false;
            shapeSeries.Pen.Style          = PenStyle;
            shapeSeries.Style              = ShapeStyle;
            shapeSeries.XYStyle            = ShapeXYStyles.Axis;
            shapeSeries.Color              = SeriesColor;
            shapeSeries.Pen.Color          = PenColor;
            shapeSeries.Brush.Transparency = Transparency;

            return(shapeSeries);
        }
        public void DrawXLine(long Tick, Color LineColor, float LineWidth = 2, System.Drawing.Drawing2D.DashStyle LineStyle = System.Drawing.Drawing2D.DashStyle.Solid)
        {
            D2DGraphics g       = baseEvent.D2DGraphics;
            long        MinTick = pprops.PianoStartTick;
            long        MaxTick = pprops.PianoStartTick + (long)Math.Round(pprops.dertPixel2dertTick(baseEvent.ClipRectangle.Width), 0) + 1;

            if (Tick <= MaxTick && Tick >= MinTick)
            {
                long ETick = Tick - MinTick;//获得左边界距离启绘点距离;
                if (ETick >= 0)
                {
                    long NodeXPixel = baseEvent.ClipRectangle.X + (int)Math.Round(pprops.dertTick2dertPixel(ETick), 0);
                    g.DrawLine(new Point((int)NodeXPixel, baseEvent.ClipRectangle.Top), new Point((int)NodeXPixel, baseEvent.ClipRectangle.Bottom), LineColor, LineWidth, LineStyle);
                }
            }
        }
Exemple #29
0
        internal static PenDashStyle xlat(System.Drawing.Drawing2D.DashStyle style)
        {
            switch (style)
            {
            case System.Drawing.Drawing2D.DashStyle.Dot: return(PenDashStyle.Dot);

            case System.Drawing.Drawing2D.DashStyle.Dash: return(PenDashStyle.Dash);

            case System.Drawing.Drawing2D.DashStyle.DashDot: return(PenDashStyle.DashDot);

            case System.Drawing.Drawing2D.DashStyle.DashDotDot: return(PenDashStyle.DashDotDot);

            case System.Drawing.Drawing2D.DashStyle.Solid: return(PenDashStyle.Solid);

            default: return(PenDashStyle.Solid);
            }
        }
Exemple #30
0
        private void ChangeStyle(System.Drawing.Drawing2D.DashStyle DashStyle)
        {
            Pen Pen;

            if (EditableLine != null)
            {
                Pen              = new Pen(EditableLine.Pen.Color, EditableLine.Pen.Width);
                Pen.DashStyle    = DashStyle;
                EditableLine.Pen = Pen;
            }
            else
            if (EditablePolyline != null)
            {
                Pen                  = new Pen(EditablePolyline.Pen.Color, EditablePolyline.Pen.Width);
                Pen.DashStyle        = DashStyle;
                EditablePolyline.Pen = Pen;
            }
        }
        /// <summary>
        /// Ctor for properties.
        /// </summary>
        public HelpLineProperties()
        {
            active = true;

            crossEnabled = true;
            snapOnResize = true;
            snapEnabled  = true;
            snapZone     = 12;
            snapgrid     = 16;
            snapelements = true;
            lineXEnabled = true;
            lineYEnabled = true;
            x            = 100;
            y            = 100;
            color        = Color.Blue;
            lineVisible  = true;
            width        = 1;
            dash         = System.Drawing.Drawing2D.DashStyle.Solid;
        }
Exemple #32
0
		/// <summary>
		/// Copies from another PlotItem with a deep copy.
		/// </summary>
		public virtual void CopyFrom(PlotItem item) {
			model = item.model;
			name = (string)item.name.Clone();
			color = item.color;
			lineStyle = item.lineStyle;
			lineWidth = item.lineWidth;
			recalc = item.recalc;
			code = item.code;
			errors = (string[])errors.Clone();
		}
Exemple #33
0
 public LinePatternChange(MapNode node, System.Drawing.Drawing2D.DashStyle oldValue)
 {
     this.node = node;
     this.oldValue = oldValue;
 }
Exemple #34
0
        /// <summary>
        /// The event when this window is closing.
        /// </summary>
        /// <param name="sender">LineStyleDialog</param>
        /// <param name="e">FormClosingEventArgs</param>
        private void LineStyleDialogClosing(object sender, FormClosingEventArgs e)
        {
            if (this.DialogResult == DialogResult.Cancel) return;
            int dummy;
            if (!Int32.TryParse(lineTextBox.Text, out dummy) ||
                dummy <= 0 || dummy > 16)
            {
                Util.ShowErrorDialog(String.Format(MessageResources.ErrInvalidValue, groupBox2.Text));
                e.Cancel = true;
                return;
            }
            m_width = dummy;

            if (solidRadioButton.Checked == true)
                m_style = System.Drawing.Drawing2D.DashStyle.Solid;
            else if (dashRadioButton.Checked == true)
                m_style = System.Drawing.Drawing2D.DashStyle.Dash;
            else if (dashDotRadioButton.Checked == true)
                m_style = System.Drawing.Drawing2D.DashStyle.DashDot;
            else if (dotRadioButton.Checked == true)
                m_style = System.Drawing.Drawing2D.DashStyle.Dot;
            else if (dashDotDotRadioButton.Checked == true)
                m_style = System.Drawing.Drawing2D.DashStyle.DashDotDot;
        }