示例#1
0
        public void SetMapBackground(string s, double e, double n, double w, double h)
        {
            if(s == null || s.Length == 0)
            {
                bkImgType = BackgroundMapType.None;
                DrawGrid();
                PicBox.Refresh();
                return;
            }
            importBmp = LoadBitmapWithoutLockFile(s);
            if (importBmp == null || importBmp.Width < 100 || importBmp.Height < 100)
            {
                bkImgType = BackgroundMapType.None;
                DrawGrid();
                PicBox.Refresh();
                return;
            }
            importBmp.SetResolution(96.0F, 96.0F);
            topLeft = new CoorPoint(e, n);
            bottomRight = new CoorPoint(e + w, n - h);

            bkImgType = BackgroundMapType.ImportImage;
            DrawGrid();
            PicBox.Refresh();
        }
示例#2
0
        public void SetMapBackground(string tl, string tr, string bl, string br)
        {
            FreeStaticMaps();
            tlBmp = LoadBitmapWithoutLockFile(tl);
            trBmp = LoadBitmapWithoutLockFile(tr);
            blBmp = LoadBitmapWithoutLockFile(bl);
            brBmp = LoadBitmapWithoutLockFile(br);
            bkImgType = BackgroundMapType.GoogleStaticMap;

            Graphics g = Graphics.FromImage(gridBmp );
            g.DrawImage(tlBmp, 640, 640);
            g.DrawImage(trBmp, 0, 640);
            g.DrawImage(blBmp, 640, 0);
            g.DrawImage(brBmp, 0, 0);
            g.Dispose();

            DrawGrid();
            PicBox.Refresh();
        }
示例#3
0
 public void ClearMapBackground()
 {
     FreeStaticMaps();
     bkImgType = BackgroundMapType.None;
     DrawGrid();
     PicBox.Refresh();
 }
 public bool DownloadGoogleStaticMap()
 {
     if (File.Exists(tl))
     {
         File.Delete(tl);
     }
     if (File.Exists(tr))
     {
         File.Delete(tr);
     }
     if (File.Exists(bl))
     {
         File.Delete(bl);
     }
     if (File.Exists(br))
     {
         File.Delete(br);
     }
     if (!inputGrid.DownloadGridMap(coorType, tl, tr, bl, br))
     {//coorType
         MessageBox.Show("無法取得線上地圖!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         //bkImgType = BackgroundMapType.None;
         return false;
     }
     bkImgType = BackgroundMapType.GoogleStaticMap;
     return true;
 }
 public void ClearBackgroundMapType()
 {
     bkImgType = BackgroundMapType.None;
 }
 public void SetImportImageMode()
 {
     bkImgType = BackgroundMapType.ImportImage;
 }