Ejemplo n.º 1
0
        public static HitTestInfo CreateNewByDrag(XDrawing drawing, Point startPt, out XDrawingModes newMode)
        {
            var path = new Path();

            path.Stroke          = new SolidColorBrush(Colors.Black);
            path.StrokeThickness = 1.0;
            path.Data            = new EllipseGeometry(startPt, 0.0, 5.0);
            var          shape = new XDrawingEllipse(drawing, path);
            ControlPoint cp;

            shape.CreateControlPoints(false, out cp);
            //newMode = XDrawingModes.Select;
            newMode = XDrawingModes.Edit;
            var hti = new HitTestInfo();

            hti.Shape        = shape;
            hti.Offset       = new Vector(0.0, 0.0);
            hti.ControlPoint = cp;
            return(hti);
        }
Ejemplo n.º 2
0
        public static HitTestInfo CreateNewByDrag(XDrawing drawing, Point startPt, out XDrawingModes newMode)
        {
            var path = new Path();

            path.Fill            = new SolidColorBrush(Colors.Black);
            path.StrokeThickness = 1.0;
            var shape = new XDrawingText(drawing, path);

            shape.TopLeft     = startPt;
            shape.BottomRight = startPt;
            ControlPoint cp;

            shape.CreateControlPoints(false, out cp);
            //newMode = XDrawingModes.Select;
            newMode = XDrawingModes.Edit;
            var hti = new HitTestInfo();

            hti.Shape        = shape;
            hti.Offset       = new Vector(0.0, 0.0);
            hti.ControlPoint = cp;
            return(hti);
        }