Example #1
1
 private Image downloadmap(string src)
 {
     Image img = null;
     try {
         //strImgsvrUrl = "http://mt3.google.cn/vt/[email protected],[email protected]&hl=zh-CN&gl=cn&";
         HttpProc.WebClient client = new HttpProc.WebClient();
         Stream stream = client.DownloadData(strImgsvrUrl + src);
         byte[] buff = new byte[stream.Length];
         stream.Read(buff, 0, (int)stream.Length);
        //byte[] buff = webClient.DownloadData(strImgsvrUrl + src);
         if (buff != null && buff.Length > 0) {
             img = Bitmap.FromStream(new MemoryStream(buff));
             db.Set(new MapClass(mapType + src, buff));
             db.Commit();
         }
     } catch { } finally { }
     return img;
 }
Example #2
0
 private Image downloadmap(string src)
 {
     Image img = null;
     try {
         HttpProc.WebClient client = new HttpProc.WebClient();
         Stream stream = client.DownloadData(strImgsvrUrl + src);
         byte[] buff = new byte[stream.Length];
         stream.Read(buff, 0, (int)stream.Length);
         if (buff != null && buff.Length > 0)
         {
             img = Bitmap.FromStream(new MemoryStream(buff));
             db.Set(new MapClass(mapType + src, buff));
             db.Commit();
         }
         //byte[] buff = webClient.DownloadData(strImgsvrUrl + src);
         //if (buff != null && buff.Length > 0)
         //{
         //    img = Bitmap.FromStream(new MemoryStream(buff));
         //    db.Set(new MapClass(mapType + src, buff));
         //}
     } catch { }finally{}
     return img;
 }