Inheritance: GraphicShape, IConstructable
示例#1
0
        public void ConstructMouseUp(IMapDocument doc, System.Windows.Forms.MouseEventArgs e)
        {
            _mousePressed = false;

            if (ActiveDisplay(doc) == null || _addContainer == null || _addContainer.Elements.Count == 0)
            {
                return;
            }

            Freehand element = _addContainer.Elements[0] as Freehand;
            if (element == null)
            {
                return;
            }

            element.Symbol = _symbol.Clone() as ISymbol;
            element.Template = element._pLine;

            IEnvelope env = element._pLine.Envelope;
            element.Scale(env.Width, env.Height);
            element.Translation(env.minx, env.miny);
            element._pLine = null;

            GraphicShape.AddElementToContainer(doc, element);

            _addContainer = null;
        }
示例#2
0
        public void ConstructMouseDown(IMapDocument doc, System.Windows.Forms.MouseEventArgs e)
        {
            if (ActiveDisplay(doc) == null)
            {
                return;
            }

            Freehand element = new Freehand();

            _addContainer = new GraphicsContainer();
            _addContainer.Elements.Add(element);

            _mousePressed = true;
            double x = e.X;
            double y = e.Y;
            ActiveDisplay(doc).Image2World(ref x, ref y);

            element.AddPoint(x, y);
        }