public PrintHelper(ItopVectorControl tc, Itop.MapView.IMapViewObj map) { //int chose = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("chose")); //if (chose == 1) //{ map = new Itop.MapView.MapViewObj(); } //else if (chose == 2) //{ map = new Itop.MapView.MapViewObj2(); } tlVectorControl1 = tc; mapview = map; pdoc = new PrintDocument(); pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage); pageSetting = pdoc.PrinterSettings.DefaultPageSettings; }
public CtrlSvgView_wh() { //fInfo.Owner = this.FindForm(); tip = new DevComponents.DotNetBar.ToolTip(); Pen pen1 = new Pen(Brushes.Cyan, 3); InitializeComponent(); this.dotNetBarManager1.Images = ItopVector.Resource.ResourceHelper.LoadBitmapStrip(base.GetType(), "ItopVector.Tools.ToolbarImages.bmp", new Size(16, 16), new Point(0, 0)); tlVectorControl1.ScaleChanged += new EventHandler(tlVectorControl1_ScaleChanged); tlVectorControl1.RightClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_RightClick); tlVectorControl1.LeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_LeftClick); tlVectorControl1.DoubleLeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_DoubleLeftClick); //tlVectorControl1.AfterPaintPage += new ItopVector.DrawArea.PaintMapEventHandler(tlVectorControl1_AfterPaintPage); ItopVector.SpecialCursors.LoadCursors(); tlVectorControl1.DrawMode = DrawModeType.MemoryImage; tlVectorControl1.TempPen = pen1; popupContainerEdit1.Text = selLar; tlVectorControl1.CanEdit = true; contextMenuStrip1.Enabled = false; ButtonEnb(false); tlVectorControl1.DrawArea.ViewMargin = new Size(20000, 20000); //mapview.ZeroLongLat = new LongLat(117.6787m, 31.0568m); tlVectorControl1.ContextMenuStrip = null; //lgm 修改 //jd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("jd")); //wd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("wd")); jd = MIS.JD; wd = MIS.WD; chose = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("chose")); show3d = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("show3d")); //mapview.ZeroLongLat = new LongLat(117.6787m, 31.0568m); if (show3d == 1) { checkEdit1.Visible = true; } else if (show3d == 0) { checkEdit1.Visible = false; } //lgm chose取不到值,暂时修改值为1 if (chose == 0) { chose = 1; } if (chose == 1) { //mapview2 = new Itop.MapView.MapViewObj("MapData3d.yap"); mapview = new Itop.MapView.MapViewObj(); // mapview = mapview1; } else if (chose == 2) { mapview = new Itop.MapView.MapViewGoogle(); (mapview as MapViewGoogle).IsDownMap = true; } mapview.ZeroLongLat = new LongLat(jd, wd); }
private void checkEdit1_CheckedChanged(object sender, EventArgs e) { if (chose == 1) { if (checkEdit1.Checked) { mapview = new Itop.MapView.MapViewObj("MapData3d.yap"); } else { mapview = new Itop.MapView.MapViewObj(); } mapview.ZeroLongLat = new LongLat(jd, wd); tlVectorControl1.Refresh(); } }
public frmMain_wh() { propertyGrid = new PropertyGrid(); tip = new DevComponents.DotNetBar.ToolTip(); ItopVector.SpecialCursors.LoadCursors(); InitializeComponent(); tlVectorControl1.CanEdit = true; //tlVectorControl1.DrawArea.FreeSelect = true; this.dotNetBarManager1.Images = ItopVector.Resource.ResourceHelper.LoadBitmapStrip(base.GetType(), "ItopVector.Tools.ToolbarImages.bmp", new Size(16, 16), new Point(0, 0)); tlVectorControl1.LeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_LeftClick); tlVectorControl1.RightClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_RightClick); tlVectorControl1.DoubleLeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_DoubleLeftClick); tlVectorControl1.MoveIn += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_MoveIn); tlVectorControl1.MoveOut += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_MoveOut); tlVectorControl1.OnTipEvent += new ItopVector.Core.Interface.OnTipEventHandler(tlVectorControl1_OnTipEvent); tlVectorControl1.ScaleChanged += new EventHandler(tlVectorControl1_ScaleChanged); tlVectorControl1.DragAndDrop += new DragEventHandler(tlVectorControl1_DragAndDrop); tlVectorControl1.DrawArea.ViewChanged += new ItopVector.DrawArea.ViewChangedEventHandler(DrawArea_ViewChanged); tlVectorControl1.AfterPaintPage += new ItopVector.DrawArea.PaintMapEventHandler(tlVectorControl1_AfterPaintPage); tlVectorControl1.DrawArea.OnBeforeRenderTo += new ItopVector.DrawArea.PaintMapEventHandler(DrawArea_OnBeforeRenderTo); //tlVectorControl1.ScaleChanged += new EventHandler(tlVectorControl1_Move); //tlVectorControl1.MouseUp +=new MouseEventHandler(tlVectorControl1_MouseUp); tlVectorControl1.DrawArea.OnPolyLineBreak += new PolyLineBreakEventHandler(DrawArea_OnPolyLineBreak); tlVectorControl1.DocumentChanged += new OnDocumentChangedEventHandler(tlVectorControl1_DocumentChanged); tlVectorControl1.DrawArea.BeforeAddSvgElement += new AddSvgElementEventHandler(DrawArea_BeforeAddSvgElement); tlVectorControl1.DrawArea.OnAddElement += new AddSvgElementEventHandler(DrawArea_OnAddElement); tlVectorControl1.SVGDocument.OnDocumentChanged += new OnDocumentChangedEventHandler(SVGDocument_OnDocumentChanged); //tlVectorControl1.DrawArea.OnElementMove += new ElementMoveEventHandler(DrawArea_OnElementMove); tlVectorControl1.DrawArea.OnMouseDown += new MouseEventHandler(DrawArea_OnMouseDown); toolDel.Click += delegate { tlVectorControl1.Delete(); }; SvgDocument.BkImageLoad = true; Pen pen1 = new Pen(Brushes.Cyan, 3); tlVectorControl1.TempPen = pen1; tlVectorControl1.PropertyGrid = propertyGrid; tlVectorControl1.BackColor = Color.White; tlVectorControl1.OperationChanged += new EventHandler(tlVectorControl1_OperationChanged); tlVectorControl1.FullDrawMode = true; tlVectorControl1.DrawArea.ViewMargin = new Size(50000, 50000); tlVectorControl1.DrawMode = DrawModeType.MemoryImage; //lgm 修改 //jd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("jd")); //wd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("wd")); jd = (decimal)MIS.JD; wd = (decimal)MIS.WD; ghType = ConfigurationSettings.AppSettings.Get("ghType"); //mapview.ZeroLongLat = new LongLat(117.6787m, 31.0568m); //mapview.ZeroLongLat = new LongLat(108.1m, 24.75m); chose = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("chose")); show3d = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("show3d")); if (show3d == 1) { checkEdit1.Visible = true; } else if (show3d == 0) { checkEdit1.Visible = false; } if (chose == 1) { mapview = new Itop.MapView.MapViewObj(); } else if (chose == 2) { mapview = new Itop.MapView.MapViewGoogle(); } mapview.ZeroLongLat = new LongLat(jd, wd); tlVectorControl1.CurrentOperation = ToolOperation.Select; }