public void ConstructMouseDoubleClick(IMapDocument doc, System.Windows.Forms.MouseEventArgs e) { if (ActiveDisplay(doc) == null || _addContainer == null || _addContainer.Elements.Count == 0) { return; } GraphicPolygon element = _addContainer.Elements[0] as GraphicPolygon; if (element == null) { return; } // Remove the last 1 Points... element._polygon[0].RemovePoint(element._polygon[0].PointCount - 1); //element._polygon[0].ReomvePoint(element._polygon[0].PointCount - 1); element.Symbol = _symbol.Clone() as ISymbol; element.Template = element._polygon; IEnvelope env = element._polygon.Envelope; element.Scale(env.Width, env.Height); element.Translation(env.minx, env.miny); element._polygon = null; GraphicShape.AddElementToContainer(doc, element); _addContainer = null; _moveable = null; }
public void ConstructMouseClick(IMapDocument doc, System.Windows.Forms.MouseEventArgs e) { if (ActiveDisplay(doc) == null) { return; } if (_addContainer == null) { GraphicPolygon element = new GraphicPolygon(); _addContainer = new GraphicsContainer(); _addContainer.Elements.Add(element); } double x = e.X; double y = e.Y; ActiveDisplay(doc).Image2World(ref x, ref y); if (_moveable == null) { ((GraphicPolygon)_addContainer.Elements[0]).AddPoint(x, y); } else { _moveable.X = x; _moveable.Y = y; _moveable = null; } ActiveDisplay(doc).DrawOverlay(_addContainer, true); }