Пример #1
0
        private void documentControl1_RightClick(object sender, ItopVector.DrawArea.SvgElementSelectedEventArgs e)
        {
            documentControl1.Operation = ToolOperation.Select;
            curImage = null;
            if (documentControl1.SVGDocument.SelectCollection.Count > 0 && !(documentControl1.SVGDocument.CurrentElement is SVG))
            {
                contextMenuStrip1.Show(documentControl1, e.Mouse.Location);
            }
            else
            {
                curImage = mapview.FindImage(e.Mouse.Location);
                contextMenuStrip2.Show(documentControl1, e.Mouse.Location);
            }

            //			Region r=new Region();
            //			documentControl1.SelectedRectangle(r);
            //			this.Text=e.SvgElement.ID+"right";
            //			if(documentControl1.Operation==ToolOperation.Enclosure)
            //			{
            //				ArrayList aList=new ArrayList();
            //				System.Collections.CollectionBase col=documentControl1.SVGDocument.SelectCollection;
            //				IEnumerator cl=col.GetEnumerator();
            //				while(cl.MoveNext())
            //				{
            //					XmlElement xl=(XmlElement)cl.Current;
            //					aList.Add(xl.GetAttribute("info-name"));
            //				}
            //				frmSelCol frm=new frmSelCol();
            //				frm.list=aList;
            //				frm.ShowDialog(this);
            //			}
            //			documentControl1.Operation=ToolOperation.FreeTransform;
            //			((MainFrame)this.MdiParent).UpdateToolBottom(ToolOperation.FreeTransform);
        }
Пример #2
0
 void MapViewGoogle_OnDownCompleted(ClassImage mapclass)
 {
     if (mapclass.PicImage != null)
     {
         documentControl1.DrawArea.InvadateRect(mapclass.Bounds);
     }
 }
Пример #3
0
 private void pictureBox_AddMovie_Click(object sender, EventArgs e)
 {
     ClassImage.browse();
     if (ClassImage.fileImage != "")
     {
         pictureBox_AddMovie.BackgroundImage = null;
         pictureBox_AddMovie.Load(ClassImage.fileImage);
     }
 }
        private void buttonX_Treeview_Click(object sender, EventArgs e)
        {
            Bitmap bmp  = new Bitmap(buttonX_Treeview.Image);
            Bitmap bmp1 = new Bitmap(Properties.Resources.appbar_chevron_left);
            Bitmap bmp2 = new Bitmap(Properties.Resources.appbar_chevron_right);

            if (ClassImage.CompareBitmapsFast(bmp, bmp1))
            {
                while (panel_Treeview.Right > 23)
                {
                    panel_Treeview.Location = new Point(panel_Treeview.Left - 2, panel_Treeview.Top);
                }
                buttonX_Treeview.Image = Properties.Resources.appbar_chevron_right;
            }
            else if (ClassImage.CompareBitmapsFast(bmp, bmp2))
            {
                while (panel_Treeview.Right < 234)
                {
                    panel_Treeview.Location = new Point(panel_Treeview.Left + 2, panel_Treeview.Top);
                }
                buttonX_Treeview.Image = Properties.Resources.appbar_chevron_left;
            }
        }
Пример #5
0
        public void Paint(Graphics g, int width, int height, int nScaleLevel, double fLongitude, double fLatitude, ImageAttributes imageAttributes)
        {
            double longgitude = fLongitude;
            double latitude   = fLatitude;
            int    scaleLevel = nScaleLevel;

            //switch (nScaleLevel)
            //{
            //    case 10:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude-=Convert.ToDecimal(1.445394);
            //        fLongitude += Convert.ToDecimal(1.012394);
            //        break;
            //    case 9:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= Convert.ToDecimal(1.440394)/2 ;
            //        fLongitude += Convert.ToDecimal(1.022394)/2;
            //        break;
            //    case 8:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= Convert.ToDecimal(1.3200394)/4;
            //        fLongitude += Convert.ToDecimal(1.10739394)/4;
            //        break;
            //    case 7:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= Convert.ToDecimal(1.300394)/8;
            //        fLongitude += Convert.ToDecimal(0.802394)/8;
            //        break;
            //    case 6:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= Convert.ToDecimal(1.265394)/16;
            //        fLongitude += Convert.ToDecimal(0.8792394)/16;
            //        break;
            //    case 5:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= Convert.ToDecimal(0.900194)/32;
            //        fLongitude += Convert.ToDecimal(1.159994)/32;
            //        break;
            //    case 4:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= Convert.ToDecimal(0.300194) / 64;
            //        fLongitude += Convert.ToDecimal(1.359994) / 64;
            //        break;
            //    case 3:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= -Convert.ToDecimal(1.036194) / 128;
            //        fLongitude += Convert.ToDecimal(1.692099) / 128;
            //        break;
            //    case 2:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= -Convert.ToDecimal(3.4690194) / 256;
            //        fLongitude += Convert.ToDecimal(2.61009) / 256;
            //        break;
            //    case 1:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= -Convert.ToDecimal(5.37394) / 512;
            //        fLongitude += Convert.ToDecimal(4.47394) / 512;
            //        break;
            //    case 0:
            //        latitude -= Convert.ToDecimal(1.585394);
            //        longgitude += Convert.ToDecimal(1.385394);
            //        fLatitude -= Convert.ToDecimal(1.440394) / 1024;
            //        fLongitude += Convert.ToDecimal(1.022394) / 1024;
            //        break;
            //}

            int[]  iw = new int[] { Convert.ToInt32(fLongitude * 100000), Convert.ToInt32(fLatitude * 100000) };
            double sw = Math.Pow(2, scaleLevel) * 256 / 200;

            int[] gw = toMapId(iw, scaleLevel);
            int   hw = 200;
            int   jw = gw[0] - Convert.ToInt32(Math.Ceiling((width / 2d - gw[2]) / hw));
            int   kw = gw[1] - Convert.ToInt32(Math.Ceiling((height / 2d - gw[3]) / hw));
            int   lw = gw[0] + Convert.ToInt32(Math.Ceiling((width / 2d + gw[2]) / hw) - 1);
            int   zw = gw[1] + Convert.ToInt32(Math.Ceiling((height / 2d + gw[3]) / hw) - 1);

            double[] cw = new double[] { -iw[0] / sw, iw[1] / sw };



            for (int mw = jw - 30; mw <= lw + 10; mw++)
            {
                for (int _w = kw - 30; _w <= zw + 10; _w++)
                {
                    int nPicLeft = (mw * 200) + Convert.ToInt32(cw[0]) + width / 2;
                    int nPicTop  = (-1 - _w) * 200 + Convert.ToInt32(cw[1]) + height / 2;

                    string strPic = getMapImagesUrl(mw, _w, scaleLevel);
                    //不在显示范围内
                    //if (nPicLeft < -nPerWidth || nPicLeft > width || nPicTop > height || nPicTop < -nPerWidth) {
                    //    continue;
                    //}
                    ClassImage img = FindImage(strPic);

                    if (img == null)
                    {
                        img = mapview.DataHelper.GetImage(strPic);
                        if (img == null)
                        {
                            img        = new ClassImage();
                            img.PicUrl = strPic;
                        }
                        listImages.Add(img);
                    }
                    img.IsDiscard = false;
                    img.Left      = nPicLeft;
                    img.Top       = nPicTop;
                    Rectangle rect = new Rectangle(img.Left, img.Top, 1000, 1000);
                    if (img.PicImage != null && g != null)
                    {
                        //g.DrawImage(img.PicImage, img.Left, img.Top, nPerWidth, nPerWidth);
                        g.DrawImage(img.PicImage, rect, 0, 0, 1000, 1000, GraphicsUnit.Pixel, imageAttributes);
                    }
                }
            }


            double f1 = 0.00582;
            double f2 = 0.00205;
            //d1 = d1 - Convert.ToDecimal(f1);
            //d2 = d2 - Convert.ToDecimal(f2);
            double loggitude1 = longgitude - Convert.ToDouble(f1);
            double latitude1  = latitude - Convert.ToDouble(f2);

            //string s = string.Format("经{0}:纬{1}", loggitude1, latitude1);
            //g.DrawString(s, new Font("宋体", 10), Brushes.Red, 0, 0);
        }
Пример #6
0
 void map_OnDownCompleted(ClassImage mapclass) {
     if (mapclass.PicImage != null)
         documentControl1.DrawArea.InvadateRect(mapclass.Bounds);
 }