コード例 #1
0
        public override GraphicsBase CreateGraphics()
        {
            GraphicsBase b = new GraphicsPolyLine(points, lineWidth, objectColor, actualScale);

            if (this.ID != 0)
            {
                b.Id = this.ID;
                b.IsSelected = this.selected;
            }

            return b;
        }
コード例 #2
0
        public PropertiesGraphicsPolyLine(GraphicsPolyLine polyLine)
        {
            if (polyLine == null)
            {
                throw new ArgumentNullException("polyLine");
            }

            points = polyLine.GetPoints();
            lineWidth = polyLine.LineWidth;
            objectColor = polyLine.ObjectColor;
            actualScale = polyLine.ActualScale;
            ID = polyLine.Id;
            selected = polyLine.IsSelected;
        }
コード例 #3
0
        /// <summary>
        /// Create new object
        /// </summary>
        public override void OnMouseDown(DrawingCanvas drawingCanvas, MouseButtonEventArgs e)
        {
            Point p = e.GetPosition(drawingCanvas);

            newPolyLine = new GraphicsPolyLine(
                new Point[]
                {
                    p,
                    new Point(p.X + 1, p.Y + 1)
                },
                drawingCanvas.LineWidth,
                drawingCanvas.ObjectColor,
                drawingCanvas.ActualScale);

            AddNewObject(drawingCanvas, newPolyLine);

            lastX = p.X;
            lastY = p.Y;
        }
コード例 #4
0
        public override void OnMouseUp(DrawingCanvas drawingCanvas, MouseButtonEventArgs e)
        {
            newPolyLine = null;

            base.OnMouseUp(drawingCanvas, e);
        }