Ejemplo n.º 1
0
 private void LineCap_Click(object sender, System.EventArgs e)
 {
     stylePen.EndCap   = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
     stylePen.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor;
     ecap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
     scap = System.Drawing.Drawing2D.LineCap.RoundAnchor;
 }
Ejemplo n.º 2
0
 public DPLine(Point start, Point end, Color penColor, DashStyle style, System.Drawing.Drawing2D.LineCap scap, System.Drawing.Drawing2D.LineCap ecap)
 {
     p1            = start;
     p2            = end;
     this.penColor = penColor;
     this.style    = style;
     this.scap     = scap;
     this.ecap     = ecap;
 }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        protected void UpdatePen()
        {
            if (state.pen == null)
            {
                float sw = (float)(state.strokeWidth * state.scale);
                state.pen = new Pen((Color)state.strokeColor, sw);

                System.Drawing.Drawing2D.LineCap cap = System.Drawing.Drawing2D.LineCap.Flat;

                if (state.lineCap.Equals("round"))
                {
                    cap = System.Drawing.Drawing2D.LineCap.Round;
                }
                else if (state.lineCap.Equals("square"))
                {
                    cap = System.Drawing.Drawing2D.LineCap.Square;
                }

                state.pen.StartCap = cap;
                state.pen.EndCap   = cap;

                System.Drawing.Drawing2D.LineJoin join = System.Drawing.Drawing2D.LineJoin.Miter;

                if (state.lineJoin.Equals("round"))
                {
                    join = System.Drawing.Drawing2D.LineJoin.Round;
                }
                else if (state.lineJoin.Equals("bevel"))
                {
                    join = System.Drawing.Drawing2D.LineJoin.Bevel;
                }

                state.pen.LineJoin   = join;
                state.pen.MiterLimit = (float)state.miterLimit;

                if (state.dashed)
                {
                    float[] dash = new float[state.dashPattern.Length];

                    for (int i = 0; i < dash.Length; i++)
                    {
                        dash[i] = (float)(state.dashPattern[i] * state.strokeWidth);
                    }

                    state.pen.DashPattern = dash;
                }
            }
        }
Ejemplo n.º 4
0
        public static PenLineCap ToEto(this sd2.LineCap value)
        {
            switch (value)
            {
            case sd2.LineCap.Flat:
                return(PenLineCap.Butt);

            case sd2.LineCap.Round:
                return(PenLineCap.Round);

            case sd2.LineCap.Square:
                return(PenLineCap.Square);

            default:
                throw new NotSupportedException();
            }
        }
Ejemplo n.º 5
0
        public static SharpDX.Direct2D1.CapStyle ToCapStyle(System.Drawing.Drawing2D.LineCap lineCap)
        {
            switch (lineCap)
            {
            case System.Drawing.Drawing2D.LineCap.ArrowAnchor:
                return(SharpDX.Direct2D1.CapStyle.Triangle);

            case System.Drawing.Drawing2D.LineCap.Square:
                return(SharpDX.Direct2D1.CapStyle.Square);

            case System.Drawing.Drawing2D.LineCap.Flat:
                return(SharpDX.Direct2D1.CapStyle.Flat);

            case System.Drawing.Drawing2D.LineCap.Round:
                return(SharpDX.Direct2D1.CapStyle.Round);
            }
            return(SharpDX.Direct2D1.CapStyle.Flat);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="JoyStickControl" /> class.
        /// </summary>
        public JoyStickControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.centerPt      = new Point(this.Width / 2, this.Height / 2);
            this.mousePoint    = new Point(0, 0);
            this.oldMousePoint = new Point(0, 0);
            this.mouseIn       = false;
            this.BackColor     = System.Drawing.Color.Black;
            this.lineColor     = System.Drawing.Color.Red;
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.rayCap              = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
            this.rayWidth            = 12;
            this.movementSizeScaling = ((double)this.Width) / 30;
            this.Resize             += new System.EventHandler(this.resizeAdjustScaling);
        }
 private void LineCap_Click(object sender, System.EventArgs e)
 {
     stylePen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
     stylePen.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor;
     ecap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
     scap = System.Drawing.Drawing2D.LineCap.RoundAnchor;
 }
 public DPLine(Point start, Point end, Color penColor,DashStyle style,System.Drawing.Drawing2D.LineCap scap,System.Drawing.Drawing2D.LineCap ecap)
 {
     p1 = start;
     p2 = end;
     this.penColor = penColor;
     this.style = style;
     this.scap = scap;
     this.ecap = ecap;
 }